Skip to content

Commit c462da5

Browse files
committed
fix(webapp): no compensation on the not-overridden validation error
Resetting a limit with no override fails before any engine write, so the compensating re-sync is skipped for that error instead of issuing spurious reads and engine writes on a pure validation path.
1 parent 6f0388b commit c462da5

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎apps/webapp/app/v3/services/concurrencyLimitsSystem.server.ts‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,11 @@ export class ConcurrencyLimitsSystem {
136136
return findLimitByName(this.db, environment, name)
137137
.andThen((row) =>
138138
syncResetToEngine(environment, row).orElse((error) =>
139-
compensateEngineFromFreshRow(this.db, environment, row.id)
140-
.orElse(() => okAsync(undefined))
141-
.andThen(() => errAsync(error))
139+
error.type === "limit_not_overridden"
140+
? errAsync(error)
141+
: compensateEngineFromFreshRow(this.db, environment, row.id)
142+
.orElse(() => okAsync(undefined))
143+
.andThen(() => errAsync(error))
142144
)
143145
)
144146
.andThen((row) =>

0 commit comments

Comments
 (0)