FiCl Dev Blog한국어

[PR #269·274·283·285·288] Right Even When It Arrives Twice or at Once: Comparing Repeated Request Numbers and Locking Task Actions

Work completed 2026-11-25 20:33 KST · Published 2026-12-03 23:23 KST · AI model used for the work Claude Opus 5.5

[PR #269·274·283·285·288] Right Even When It Arrives Twice or at Once: Comparing Repeated Request Numbers and Locking Task ActionsSummary figure. Rejecting different content under the same request number by comparing hashes, a 30-day record list cut at Korean midnight, checking the request number before the revision number and comparing after a row lock, an order column for same-millisecond history, and shared locks between moving and task creationPR #269·274·283·285·288Right when it arrivestwice or at onceSame number → date edge → task actions → order → shared lockI chose 'asrecommended'Claude built itCodex testedIDDateTaskOrderLockⅠSame numberPR 269: rejectother content1Silent data lossSame number, other content,'saved' but onlythe first stays2Compare by hashFingerprint ofkey-sorted JSONOld rows are not comparedⅡDate edgePR 274: input,refill list3Cut at Korean midnight23:59 is left out,0:00 the next day stays4Moving the clockThe login token expires tooGet a new tokenⅢTask actionsPR 283: customerrequests5Request number firstA resend after a lost replygets the current state6Compare after row lockTwo people finish at once:one saved, one conflictⅣOrder columnPR 285:admin review7Same-millisecond historyTime alone can flip the orderI said 'as recommended'8Check when savingMatches the DB constraintsApprovals locked, one at a timeⅤShared lockPR 288: moves,HQ quests9Two gaps the review foundRead before a move or cancel,insert a task after it10Read with FOR SHARETask creationtakes a shared lockand takes turns with movingKey: check same content for the same number,and compare only after locking the row.FiCl Dev Blog · Post summary figure
[PR #269·274·283·285·288] Right Even When It Arrives Twice or at Once: Comparing Repeated Request Numbers and Locking Task ActionsSummary figure. Rejecting different content under the same request number by comparing hashes, a 30-day record list cut at Korean midnight, checking the request number before the revision number and comparing after a row lock, an order column for same-millisecond history, and shared locks between moving and task creationPR #269·274·283·285·288Right when it arrivestwice or at onceSame number → date edge → task actions → order → shared lockI chose 'asrecommended'Claude built itCodex testedIDDateTaskOrderLockⅠSame numberPR 269: rejectother content1Silent data lossSame number, other content,'saved' but onlythe first stays2Compare by hashFingerprint ofkey-sorted JSONOld rows are not comparedⅡDate edgePR 274: input,refill list3Cut at Korean midnight23:59 is left out,0:00 the next day stays4Moving the clockThe login token expires tooGet a new tokenⅢTask actionsPR 283: customerrequests5Request number firstA resend after a lost replygets the current state6Compare after row lockTwo people finish at once:one saved, one conflictⅣOrder columnPR 285:admin review7Same-millisecond historyTime alone can flip the orderI said 'as recommended'8Check when savingMatches the DB constraintsApprovals locked, one at a timeⅤShared lockPR 288: moves,HQ quests9Two gaps the review foundRead before a move or cancel,insert a task after it10Read with FOR SHARETask creationtakes a shared lockand takes turns with movingKey: check same content for the same number,and compare only after locking the row.FiCl Dev Blog · Post summary figure

These five PRs built the server requests for Detail 4 (quests, routines, head office review). They were merged one after another in a single day, and all of them held on to one question: if the same request arrives twice, or two people change the same thing at once, is the result still right?

The models were as follows. Everything ran on my Windows computer.

PR What was done Who wrote it Result
269 Reject different content under the same request number Claude (implementation), Codex (tests) 5 unit tests and 18 flow tests; review found nothing to fix
274 A list of device input and refill records Claude (tests), Codex (implementation) 6 tests failed first, then passed; review found nothing to fix
283 Today’s tasks, task actions, and undo Claude (implementation), Codex (tests) 11 tests passed; 2 review findings applied
285 Admin review, routines, versions, and a history order column Claude (implementation), Codex (tests) 17 new tests passed; 1 review finding applied
288 Moving cycles and head office quests Claude (implementation), Codex (tests) 9 tests passed; 3 review findings applied

PR 269: Reject different content under the same request number

What was done and why

The customer app attaches a request number to every save request, and if it gets no response, it resends with the same number. Until now, when the same number arrived, the server returned the first result without looking at the content. So if a bug in the app sent different content under the same number, the customer was told “saved” while only the first content actually remained. That is silent data loss (data disappearing without the user knowing). I decided to put this into Detail 4.

The six save points from Detail 3 (input records, post-input checks, material preparation, count changes, device input, refills) now also store a hash of the request body (SHA-256, a short fingerprint of the content). When the same person resends with the same number, the hashes are compared: if they match, the first result comes back; if not, a 409 (conflict) error. Two copies arriving at the same moment go through the same comparison.

What was chosen, and what was dropped

Chosen Dropped alternative Why it was dropped
Store only a hash of the request body and compare it Store the whole request body and compare it The table grows, and personal notes would be stored twice

How it was checked

PR 274: A list of device input and refill records

What was done and why

In Detail 3, the customer app could save device inputs and refills, but there was no list to look back over past records. This was another item I decided to move into Detail 4. Picking a module shows the input and refill records of the site that module belongs to, for the last 30 days by Korean date including today, newest first.

What was chosen, and what was dropped

Chosen Dropped alternative Why it was dropped
The server joins both tables in one query and returns the list The customer app builds the list from several Detail 3 requests More requests, and each app could cut the 30 days differently

How it was checked

PR 283: Today’s tasks, task actions, and undo

What was done and why

Three server requests were built so that the customer app can see “today’s tasks,” act on a task (done, normal, problem, skip), and undo. Customer responses do not include head office notes or admin names.

What was chosen, and what was dropped

Chosen Dropped alternative Why it was dropped
On a repeat request, return the task’s current state Store the first response and return it again Returning the current state means no response needs to be stored

How it was checked

PR 285: Admin review, routines, versions, and an order column for history

What was done and why

Server requests were built for head office to review problem reports in the admin web (confirm, or ask for a re-check) and to manage routines and quest list versions. And for the history-order question raised in PR 283, I answered “go with the recommendation,” so an order column was added to the action history. History is now always listed by this column.

What was chosen, and what was dropped

Chosen Dropped alternative Why it was dropped
Check quest items at save time A structural change that loosens the database constraints so checks happen only at approval Hard to roll back, and checking at save time gives the same screen flow

How it was checked

PR 288: Moving cycles and head office quests

What was done and why

Server requests were built for head office to move a running cycle to a new quest list version in the admin web, and to send head office quests to a specific module and cancel them. Before moving, it shows how many quests were already created, how many will change text or date, how many will be new, and how many will disappear. Moving leaves already-created tasks and the original pinning date as they are. A head office quest sent for today creates its task in the same transaction, so the customer sees it on refresh.

What was chosen, and what was dropped

Chosen Dropped alternative Why it was dropped
Change only the cycle’s pinned version Delete or re-create not-yet-created tasks when moving Tasks are created on their day, so the next creation already uses the new text

How it was checked

Lessons