The best way to control Claude Code, Codex and more from any computer or phone
fix(gitlab): share merge request reads across detail and checks (#24392)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Julius Marminge committed
Oct 29, 2026 at 22:10 UTC
2c119bd975deb06f49505a0af3ec8d272806b923
5 files changed
+394
-30
apps/server/src/pullRequest/PullRequestService.test.ts
+92
@@ -2189,6 +2189,98 @@ it.effect("does not revive old summaries when project epochs are evicted", () =>
2189
}),
2190
);
2191
2192
+it.effect("a refresh or a finished turn drops the provider's own change request reads", () =>
2193
+ Effect.gen(function* () {
2194
+ const forgotten: Array<{ readonly repository: string; readonly number?: number } | undefined> =
2195
+ [];
2196
+ const service = yield* makeService({
2197
+ projects: [
2198
+ project({
2199
+ id: "p1",
2200
+ title: "web",
2201
+ workspaceRoot: "/a",
2202
+ repository: "acme/web",
2203
+ provider: "gitlab",
2204
+ }),
2205
+ ],
2206
+ providers: [
2207
+ fakeProvider(SourceControlProviderKind.make("gitlab"), {
2208
+ forgetChangeRequestReads: (scope) => Effect.sync(() => void forgotten.push(scope)),
2209
+ }),
2210
+ ],
2211
+ });
2212
+ const reference = { projectId: "p1" as ProjectId, repository: "acme/web", number: 1 };
2213
+
2214
+ yield* service.invalidate({ reference });
2215
+ yield* service.refreshAfterTurn(reference.projectId);
2216
+ yield* service.invalidate({});
2217
+
2218
+ assert.deepStrictEqual(forgotten, [
2219
+ { repository: "acme/web", number: 1 },
2220
+ undefined,
2221
+ undefined,
2222
+ ]);
2223
+ }),
2224
+);
2225
+
2226
+it.effect("a read during a refresh cannot keep the provider's old change request", () =>
2227
+ Effect.gen(function* () {
2228
+ let hostTitle = "old";
2229
+ let held: string | undefined;
2230
+ let gate:
2231
+ | { readonly entered: Deferred.Deferred<void>; readonly release: Deferred.Deferred<void> }
2232
+ | undefined;
2233
+ const service = yield* makeService({
2234
+ projects: [
2235
+ project({
2236
+ id: "p1",
2237
+ title: "web",
2238
+ workspaceRoot: "/a",
2239
+ repository: "acme/web",
2240
+ provider: "gitlab",
2241
+ }),
2242
+ ],
2243
+ providers: [
2244
+ fakeProvider(SourceControlProviderKind.make("gitlab"), {
2245
+ getChangeRequest: () =>
2246
+ Effect.sync(() => {
2247
+ held ??= hostTitle;
2248
+ return { ...hostedChangeRequest("body"), title: held };
2249
+ }),
2250
+ forgetChangeRequestReads: () =>
2251
+ Effect.gen(function* () {
2252
+ if (gate !== undefined) {
2253
+ yield* Deferred.succeed(gate.entered, undefined);
2254
+ yield* Deferred.await(gate.release);
2255
+ }
2256
+ held = undefined;
2257
+ }),
2258
+ }),
2259
+ ],
2260
+ });
2261
+ const reference = { projectId: "p1" as ProjectId, repository: "acme/web", number: 1 };
2262
+ const refreshWithReadInBetween = (refresh: Effect.Effect<void>) =>
2263
+ Effect.gen(function* () {
2264
+ gate = { entered: yield* Deferred.make<void>(), release: yield* Deferred.make<void>() };
2265
+ const running = yield* refresh.pipe(Effect.forkChild());
2266
+ yield* Deferred.await(gate.entered);
2267
+ yield* service.detail(reference);
2268
+ yield* Deferred.succeed(gate.release, undefined);
2269
+ yield* Fiber.join(running);
2270
+ gate = undefined;
2271
+ });
2272
+
2273
+ assert.strictEqual((yield* service.detail(reference)).title, "old");
2274
+ hostTitle = "after turn";
2275
+ yield* refreshWithReadInBetween(service.refreshAfterTurn(reference.projectId));
2276
+ assert.strictEqual((yield* service.detail(reference)).title, "after turn");
2277
+
2278
+ hostTitle = "after refresh";
2279
+ yield* refreshWithReadInBetween(service.invalidate({ reference }));
2280
+ assert.strictEqual((yield* service.detail(reference)).title, "after refresh");
2281
+ }),
2282
+);
2283
+
2284
it.effect("close and reopen notify subscribed readers after invalidating their cached state", () =>
2285
Effect.scoped(
2286
Effect.gen(function* () {
apps/server/src/pullRequest/PullRequestService.ts
+35
-18
@@ -528,6 +528,9 @@ function withRateLimitBackoff(
528
listChangeRequestStats: wrap("listChangeRequestStats", api.listChangeRequestStats),
529
}),
530
getChangeRequest: wrap("getChangeRequest", api.getChangeRequest),
531
+ ...(api.forgetChangeRequestReads === undefined
532
+ ? {}
533
+ : { forgetChangeRequestReads: api.forgetChangeRequestReads }),
534
...(api.getChangeRequestPreview === undefined
535
? {}
536
: { getChangeRequestPreview: wrap("getChangeRequestPreview", api.getChangeRequestPreview) }),
@@ -3423,6 +3426,13 @@ export const make = Effect.gen(function* () {
3426
return { stats: [...held, ...result.stats] };
3427
});
3428
3429
+ const forgetProviderReads = (scope?: { readonly repository: string; readonly number?: number }) =>
3430
+ Effect.forEach(
3431
+ registry.kinds,
3432
+ (kind) => registry.get(kind)?.forgetChangeRequestReads?.(scope) ?? Effect.void,
3433
+ { discard: true },
3434
+ );
3435
+
3436
const invalidate: PullRequestService["Service"]["invalidate"] = Effect.fn(
3437
"PullRequestService.invalidate",
3438
)(function* (input, options) {
@@ -3438,13 +3448,15 @@ export const make = Effect.gen(function* () {
3448
if (reference !== undefined) {
3449
yield* canonicalRef(reference).pipe(
3450
Effect.flatMap((ref) =>
3441
- readCache
3442
- .invalidate(refScope(ref))
3443
- .pipe(Effect.andThen(Effect.sync(() => bumpRefEpoch(ref)))),
3451
+ forgetProviderReads({ repository: ref.repository, number: ref.number }).pipe(
3452
+ Effect.andThen(readCache.invalidate(refScope(ref))),
3453
+ Effect.andThen(Effect.sync(() => bumpRefEpoch(ref))),
3454
+ ),
3455
),
3456
Effect.ignore,
3457
);
3458
} else {
3459
+ yield* forgetProviderReads();
3460
listingsEpoch = ++epochCounter;
3461
everyFileRevisionEpoch = ++epochCounter;
3462
viewersByHost.clear();
@@ -3455,22 +3467,27 @@ export const make = Effect.gen(function* () {
3467
}
3468
});
3469
3458
- const refreshAfterTurn: PullRequestService["Service"]["refreshAfterTurn"] = (projectId) =>
3459
- Effect.suspend(() => {
3460
- listingsEpoch = ++epochCounter;
3461
- projectEpochs.delete(projectId);
3462
- if (projectEpochs.size >= REF_EPOCH_CAPACITY) {
3463
- const oldest = projectEpochs.keys().next().value;
3464
- if (oldest !== undefined) {
3465
- projectEpochFloor = projectEpochs.get(oldest)!;
3466
- projectEpochs.delete(oldest);
3467
- }
3470
+ const refreshAfterTurn: PullRequestService["Service"]["refreshAfterTurn"] = Effect.fn(
3471
+ "PullRequestService.refreshAfterTurn",
3472
+ )(function* (projectId) {
3473
+ // Everything the provider holds, not just the project's repository: a turn can touch a
3474
+ // change request reached through another repository, and no epoch may move until those
3475
+ // reads are gone, or a reader in between keeps the old one under the new epoch.
3476
+ yield* forgetProviderReads();
3477
+ listingsEpoch = ++epochCounter;
3478
+ projectEpochs.delete(projectId);
3479
+ if (projectEpochs.size >= REF_EPOCH_CAPACITY) {
3480
+ const oldest = projectEpochs.keys().next().value;
3481
+ if (oldest !== undefined) {
3482
+ projectEpochFloor = projectEpochs.get(oldest)!;
3483
+ projectEpochs.delete(oldest);
3484
}
3469
- projectEpochs.set(projectId, listingsEpoch);
3470
- return readCache
3471
- .invalidate(`project:${projectId}`)
3472
- .pipe(Effect.andThen(SubscriptionRef.set(pullRequestRefreshes, listingsEpoch)));
3473
- });
3485
+ }
3486
+ projectEpochs.set(projectId, listingsEpoch);
3487
+ const epoch = listingsEpoch;
3488
+ yield* readCache.invalidate(`project:${projectId}`);
3489
+ yield* SubscriptionRef.set(pullRequestRefreshes, epoch);
3490
+ });
3491
3492
const invalidatedByMutation =
3493
<I extends PullRequestRef>(
packages/source-control-core/src/server/PullRequestProvider.ts
+10
@@ -353,6 +353,16 @@ export interface PullRequestProviderApi {
353
input: ProviderRepositoryRef & { readonly number: number },
354
) => Effect.Effect<ProviderChangeRequestDetail, PullRequestProviderError>;
355
356
+ /**
357
+ * For a provider that holds change request reads of its own: called when the service drops its
358
+ * reads, so a refresh or a finished turn reaches the host. No scope forgets everything; a scope
359
+ * without a number forgets the repository's change requests.
360
+ */
361
+ readonly forgetChangeRequestReads?: (scope?: {
362
+ readonly repository: string;
363
+ readonly number?: number;
364
+ }) => Effect.Effect<void>;
365
+
366
readonly getChangeRequestPreview?: (
367
input: ProviderRepositoryRef & { readonly number: number },
368
) => Effect.Effect<
packages/source-control-gitlab/src/server/GitLabPullRequestProvider.test.ts
+152
@@ -1,6 +1,7 @@
1
import { assert, describe, expect, it } from "@effect/vitest";
2
import * as Effect from "effect/Effect";
3
import * as Layer from "effect/Layer";
4
+import * as TestClock from "effect/testing/TestClock";
5
6
import * as GitLabCli from "./GitLabCli.ts";
7
import * as GitLabPullRequestCli from "./GitLabPullRequestCli.ts";
@@ -122,6 +123,157 @@ describe("getChangeRequest base freshness", () => {
123
);
124
});
125
126
+describe("merge request reads", () => {
127
+ const reference = { cwd: "/w", repository: "acme/web", host: "gitlab.com", number: 7 };
128
+ const detail = {
129
+ number: 7,
130
+ title: "Merge request 7",
131
+ url: "https://gitlab.com/acme/web/-/merge_requests/7",
132
+ author: null,
133
+ headBranch: "feat/page",
134
+ baseBranch: "main",
135
+ state: "open" as const,
136
+ isDraft: false,
137
+ mergeability: "mergeable" as const,
138
+ additions: 0,
139
+ deletions: 0,
140
+ createdAt: "2026-07-01T00:00:00Z",
141
+ updatedAt: "2026-07-02T00:00:00Z",
142
+ reviewRequestLogins: [],
143
+ labels: [],
144
+ body: "",
145
+ changedFiles: 1,
146
+ mergedAt: null,
147
+ closedAt: null,
148
+ reviewers: [],
149
+ checks: [],
150
+ viewerCanMerge: true,
151
+ reviewerIds: [],
152
+ };
153
+
154
+ const countingProvider = Effect.gen(function* () {
155
+ const calls = { detail: 0, mergeCapabilities: 0 };
156
+ const host = { viewerCanMerge: true };
157
+ const provider = yield* make.pipe(
158
+ Effect.provide(
159
+ Layer.mock(GitLabPullRequestCli.GitLabPullRequestCli)({
160
+ getMergeRequestDetail: (input) =>
161
+ Effect.sync(() => {
162
+ calls.detail += 1;
163
+ return { ...detail, number: input.number, viewerCanMerge: host.viewerCanMerge };
164
+ }),
165
+ getProjectMergeCapabilities: () =>
166
+ Effect.sync(() => {
167
+ calls.mergeCapabilities += 1;
168
+ return { merge: true, squash: true, rebase: true };
169
+ }),
170
+ runMergeRequestAction: () => Effect.void,
171
+ }),
172
+ ),
173
+ );
174
+ const checks = provider.getChangeRequestChecks;
175
+ const forget = provider.forgetChangeRequestReads;
176
+ if (checks === undefined || forget === undefined) {
177
+ return yield* Effect.die("GitLab answers checks and forgets its reads");
178
+ }
179
+ return { provider, checks, forget, calls, host };
180
+ });
181
+
182
+ it.effect("asks for a project's merge methods once across its merge requests", () =>
183
+ Effect.gen(function* () {
184
+ const { provider, calls } = yield* countingProvider;
185
+
186
+ yield* provider.getChangeRequest(reference);
187
+ yield* provider.getChangeRequest(reference);
188
+ yield* provider.getChangeRequest({ ...reference, number: 8 });
189
+
190
+ expect(calls.mergeCapabilities).toBe(1);
191
+ }),
192
+ );
193
+
194
+ it.effect("answers checks from the merge request the detail just read", () =>
195
+ Effect.gen(function* () {
196
+ const { provider, checks, calls } = yield* countingProvider;
197
+
198
+ yield* provider.getChangeRequest(reference);
199
+ yield* checks(reference);
200
+
201
+ expect(calls.detail).toBe(1);
202
+ }),
203
+ );
204
+
205
+ it.effect("reads a merge request again after a write to it", () =>
206
+ Effect.gen(function* () {
207
+ const { provider, checks, calls } = yield* countingProvider;
208
+
209
+ yield* provider.getChangeRequest(reference);
210
+ yield* provider.runAction({ ...reference, action: "ready" });
211
+ yield* checks(reference);
212
+
213
+ expect(calls.detail).toBe(2);
214
+ }),
215
+ );
216
+
217
+ it.effect("does not share reads between checkouts", () =>
218
+ Effect.gen(function* () {
219
+ const { provider, calls } = yield* countingProvider;
220
+
221
+ yield* provider.getChangeRequest(reference);
222
+ yield* provider.getChangeRequest({ ...reference, cwd: "/other" });
223
+
224
+ expect(calls).toEqual({ detail: 2, mergeCapabilities: 2 });
225
+ }),
226
+ );
227
+
228
+ it.effect("reads a merge request again once a minute has passed", () =>
229
+ Effect.gen(function* () {
230
+ const { provider, calls } = yield* countingProvider;
231
+
232
+ yield* provider.getChangeRequest(reference);
233
+ yield* TestClock.adjust("61 seconds");
234
+ yield* provider.getChangeRequest(reference);
235
+
236
+ expect(calls.detail).toBe(2);
237
+ }),
238
+ );
239
+
240
+ it.effect("answers viewer permissions from the host, not the page's read", () =>
241
+ Effect.gen(function* () {
242
+ const { provider, host } = yield* countingProvider;
243
+
244
+ host.viewerCanMerge = false;
245
+ yield* provider.getChangeRequest(reference);
246
+ host.viewerCanMerge = true;
247
+ const granted = yield* provider.getViewerPermissions(reference);
248
+ host.viewerCanMerge = false;
249
+ const revoked = yield* provider.getViewerPermissions(reference);
250
+
251
+ expect(granted.actions).toContain("merge");
252
+ expect(revoked.actions).not.toContain("merge");
253
+ }),
254
+ );
255
+
256
+ it.effect("reads a merge request again once its reads are forgotten", () =>
257
+ Effect.gen(function* () {
258
+ const { provider, checks, forget, calls } = yield* countingProvider;
259
+ const other = { ...reference, repository: "acme/api" };
260
+
261
+ yield* provider.getChangeRequest(reference);
262
+ yield* provider.getChangeRequest(other);
263
+ yield* forget({ repository: "ACME/web", number: 7 });
264
+ yield* checks(reference);
265
+ yield* checks(other);
266
+ expect(calls.detail).toBe(3);
267
+
268
+ yield* forget({ repository: "acme/web" });
269
+ yield* checks(reference);
270
+ yield* forget();
271
+ yield* checks(other);
272
+ expect(calls.detail).toBe(5);
273
+ }),
274
+ );
275
+});
276
+
277
describe("optional activity reads", () => {
278
const reference = { cwd: "/w", repository: "acme/web", host: "gitlab.com", number: 7 };
279
const comment = {
packages/source-control-gitlab/src/server/GitLabPullRequestProvider.ts
+105
-12
@@ -1,5 +1,8 @@
1
import { SourceControlProviderKind } from "@t3tools/contracts";
2
+import * as Cache from "effect/Cache";
3
+import * as Duration from "effect/Duration";
4
import * as Effect from "effect/Effect";
5
+import * as Exit from "effect/Exit";
6
import type {
7
PullRequestCapabilities,
8
PullRequestReaction,
@@ -72,6 +75,16 @@ export function gitLabViewerPermissions(input: {
75
};
76
}
77
78
+/**
79
+ * One page view asks for the detail and then its checks within a second, and the poll that
80
+ * follows asks again. A minute keeps those to one `glab` call without hiding a pipeline for long;
81
+ * a refresh or a finished turn drops it sooner through `forgetChangeRequestReads`.
82
+ */
83
+const MERGE_REQUEST_DETAIL_TTL = Duration.minutes(1);
84
+/** A project's merge methods change in its settings, which nobody does between page views. */
85
+const PROJECT_MERGE_CAPABILITIES_TTL = Duration.minutes(15);
86
+const READ_CACHE_CAPACITY = 256;
87
+
88
function gitLabProviderFailure(
89
error: GitLabPullRequestCli.GitLabPullRequestCliError,
90
): PullRequestProviderFailure {
@@ -85,6 +98,55 @@ function gitLabProviderFailure(
98
export const make = Effect.gen(function* () {
99
const cli = yield* GitLabPullRequestCli.GitLabPullRequestCli;
100
101
+ // Keyed on the checkout as well: `glab` picks the host and the account to answer as from the
102
+ // checkout's remote and config, so two checkouts may read the same project as different people.
103
+ const mergeRequestDetails = yield* Cache.makeWith(
104
+ (key: string) => {
105
+ const [cwd, repository, number] = JSON.parse(key) as [string, string, number];
106
+ return cli.getMergeRequestDetail({ cwd, repository, number });
107
+ },
108
+ {
109
+ capacity: READ_CACHE_CAPACITY,
110
+ timeToLive: (exit) => (Exit.isSuccess(exit) ? MERGE_REQUEST_DETAIL_TTL : Duration.zero),
111
+ },
112
+ );
113
+ const projectMergeCapabilities = yield* Cache.makeWith(
114
+ (key: string) => {
115
+ const [cwd, repository] = JSON.parse(key) as [string, string];
116
+ return cli.getProjectMergeCapabilities({ cwd, repository });
117
+ },
118
+ {
119
+ capacity: READ_CACHE_CAPACITY,
120
+ timeToLive: (exit) => (Exit.isSuccess(exit) ? PROJECT_MERGE_CAPABILITIES_TTL : Duration.zero),
121
+ },
122
+ );
123
+
124
+ const detailKey = (input: {
125
+ readonly cwd: string;
126
+ readonly repository: string;
127
+ readonly number: number;
128
+ }) => JSON.stringify([input.cwd, input.repository, input.number]);
129
+ const mergeRequestDetail = (input: {
130
+ readonly cwd: string;
131
+ readonly repository: string;
132
+ readonly number: number;
133
+ }) => Cache.get(mergeRequestDetails, detailKey(input));
134
+
135
+ // Dropped on both sides, as the service does with its own reads: a read that starts while the
136
+ // write is in flight must not outlive it.
137
+ const writing =
138
+ <
139
+ I extends { readonly cwd: string; readonly repository: string; readonly number: number },
140
+ A,
141
+ E,
142
+ >(
143
+ write: (input: I) => Effect.Effect<A, E>,
144
+ ) =>
145
+ (input: I): Effect.Effect<A, E> => {
146
+ const invalidate = Cache.invalidate(mergeRequestDetails, detailKey(input));
147
+ return invalidate.pipe(Effect.andThen(write(input)), Effect.ensuring(invalidate));
148
+ };
149
+
150
const fail = (operation: string) => (error: GitLabPullRequestCli.GitLabPullRequestCliError) =>
151
new PullRequestProviderError({
152
provider: SourceControlProviderKind.make("gitlab"),
@@ -138,7 +200,7 @@ export const make = Effect.gen(function* () {
200
),
201
202
getChangeRequestChecks: (input) =>
141
- cli.getMergeRequestDetail(input).pipe(
203
+ mergeRequestDetail(input).pipe(
204
Effect.map(({ state, checks }) => ({ state, checks })),
205
Effect.mapError(fail("getChangeRequestChecks")),
206
),
@@ -153,8 +215,8 @@ export const make = Effect.gen(function* () {
215
getChangeRequest: (input) =>
216
Effect.all(
217
[
156
- cli.getMergeRequestDetail(input),
157
- cli.getProjectMergeCapabilities({ cwd: input.cwd, repository: input.repository }),
218
+ mergeRequestDetail(input),
219
+ Cache.get(projectMergeCapabilities, JSON.stringify([input.cwd, input.repository])),
220
],
221
{ concurrency: 2 },
222
).pipe(
@@ -209,11 +271,31 @@ export const make = Effect.gen(function* () {
271
})),
272
),
273
274
+ // Straight from the host, never the shared read: this is what a write is refused or let
275
+ // through on, and access granted or withdrawn within the minute must count.
276
getViewerPermissions: (input) =>
277
cli
278
.getMergeRequestDetail(input)
279
.pipe(Effect.mapError(fail("getViewerPermissions")), Effect.map(gitLabViewerPermissions)),
280
281
+ forgetChangeRequestReads: (scope) =>
282
+ Cache.keys(mergeRequestDetails).pipe(
283
+ Effect.flatMap((keys) =>
284
+ Effect.forEach(
285
+ Array.from(keys).filter((key) => {
286
+ if (scope === undefined) return true;
287
+ const [, repository, number] = JSON.parse(key) as [string, string, number];
288
+ return (
289
+ repository.toLowerCase() === scope.repository.toLowerCase() &&
290
+ (scope.number === undefined || number === scope.number)
291
+ );
292
+ }),
293
+ (key) => Cache.invalidate(mergeRequestDetails, key),
294
+ { discard: true },
295
+ ),
296
+ ),
297
+ ),
298
+
299
getDiff: (input) => cli.getMergeRequestDiff(input).pipe(Effect.mapError(fail("getDiff"))),
300
301
getDiffFileContents: (input) =>
@@ -245,7 +327,7 @@ export const make = Effect.gen(function* () {
327
.listProjectUsers({ cwd: input.cwd, repository: input.repository, search: input.query })
328
.pipe(Effect.mapError(fail("searchRepositoryAuthors"))),
329
248
- setReviewerRequest: (input) =>
330
+ setReviewerRequest: writing((input) =>
331
cli
332
.setReviewerRequest({
333
cwd: input.cwd,
@@ -255,8 +337,9 @@ export const make = Effect.gen(function* () {
337
requested: input.requested,
338
})
339
.pipe(Effect.mapError(fail("setReviewerRequest"))),
340
+ ),
341
259
- runAction: (input) =>
342
+ runAction: writing((input) =>
343
cli
344
.runMergeRequestAction({
345
cwd: input.cwd,
@@ -266,8 +349,9 @@ export const make = Effect.gen(function* () {
349
...(input.mergeMethod === undefined ? {} : { mergeMethod: input.mergeMethod }),
350
})
351
.pipe(Effect.mapError(fail("runAction"))),
352
+ ),
353
270
- updateChangeRequest: (input) =>
354
+ updateChangeRequest: writing((input) =>
355
cli
356
.updateMergeRequest({
357
cwd: input.cwd,
@@ -277,10 +361,13 @@ export const make = Effect.gen(function* () {
361
...(input.body === undefined ? {} : { description: input.body }),
362
})
363
.pipe(Effect.mapError(fail("updateChangeRequest"))),
364
+ ),
365
281
- comment: (input) => cli.commentOnMergeRequest(input).pipe(Effect.mapError(fail("comment"))),
366
+ comment: writing((input) =>
367
+ cli.commentOnMergeRequest(input).pipe(Effect.mapError(fail("comment"))),
368
+ ),
369
283
- updateComment: (input) =>
370
+ updateComment: writing((input) =>
371
cli
372
.updateNote({
373
cwd: input.cwd,
@@ -290,10 +377,13 @@ export const make = Effect.gen(function* () {
377
body: input.body,
378
})
379
.pipe(Effect.mapError(fail("updateComment"))),
380
+ ),
381
294
- submitReview: (input) => cli.submitReview(input).pipe(Effect.mapError(fail("submitReview"))),
382
+ submitReview: writing((input) =>
383
+ cli.submitReview(input).pipe(Effect.mapError(fail("submitReview"))),
384
+ ),
385
296
- replyToThread: (input) =>
386
+ replyToThread: writing((input) =>
387
cli
388
.replyToDiscussion({
389
cwd: input.cwd,
@@ -303,8 +393,9 @@ export const make = Effect.gen(function* () {
393
body: input.body,
394
})
395
.pipe(Effect.mapError(fail("replyToThread"))),
396
+ ),
397
307
- setReaction: (input) =>
398
+ setReaction: writing((input) =>
399
cli
400
.setReaction({
401
cwd: input.cwd,
@@ -315,8 +406,9 @@ export const make = Effect.gen(function* () {
406
reacted: input.reacted,
407
})
408
.pipe(Effect.mapError(fail("setReaction"))),
409
+ ),
410
319
- setThreadResolution: (input) =>
411
+ setThreadResolution: writing((input) =>
412
cli
413
.setDiscussionResolution({
414
cwd: input.cwd,
@@ -326,6 +418,7 @@ export const make = Effect.gen(function* () {
418
resolved: input.resolved,
419
})
420
.pipe(Effect.mapError(fail("setThreadResolution"))),
421
+ ),
422
};
423
424
return provider;