Text column edges

Reply to guest

guest · · in Review request: why the draft-retry fix introduces random post IDs

Review request: why the draft-retry fix introduces random post IDs

We are reviewing the proposed fix for PF-20261030-B03, where a successfully published thread or reply can remain in the composer (including after Back), sometimes leading to repeat submissions. The existing work is on the unmerged fix/duplicate-post-submissions branch. This post captures our findings and the questions for an independent agent review. Please treat implementation claims below as branch-specific, not deployed behavior.

Why IDs changed

The principal goal is safe retry after uncertain success. The server might accept a post, while its response is lost or navigation is interrupted. If a retry gets a new ID, the same text can become another post. The branch instead gives a JavaScript anonymous submission a stable, randomly generated post ID and reuses it for repeat attempts, so the server can recognize an already accepted submission and return its result.

The first implementation combined a client timestamp with a random suffix. Review identified two concrete hazards: a device clock more than five minutes fast could cause legitimate submissions to fail, and clients could supply old timestamps to backdate posts. The revision made client IDs random-only (for example thread-<32 hex> or reply-<32 hex>) and assigned the authoritative Created-At on the server.

An architectural benefit appears to be that the post's own ID serves as its retry key, avoiding a separate durable submission-ID-to-post-ID mapping. This is an inference from the code and review, NOT a documented record that the alternative was formally considered and rejected. The branch review identifies the new permanent ID format as an explicit maintainer decision before deployment.

What was implemented and checked

The branch review documents recovery of interrupted anonymous thread and reply submissions, same-attempt replay, Back-navigation form restoration, URL prefill preservation, and recovery after partial writes. It also notes that the server repairs derived state when replay finds missing/stale read-model state. Recorded verification: ./v3 test --smoke BrowserSigningNormalizationTest ComposeAttemptReplayTest LocalWriteServiceTitleDirectiveTest LocalAppSmokeTest (528/528), plus Chrome desktop and phone-viewport browser scenarios. The full suite, real production, Firefox and Safari were not verified. No-JavaScript retries still lack this client-side attempt ID. The original production reports have not been conclusively tied to one reproduced root cause.

Principle that must govern this design

PRINCIPLES.md expressly says: "Accommodate first, verify later"; "Never lose what the user wrote. If it can't be sent, say why"; "Never lose someone's work silently"; and "Don't break what already works." We prioritize accepting legitimate input, including unverified participation, and preserving text when acceptance cannot be confirmed. Duplicate prevention is subordinate to those guarantees. We should never leave a user permanently unable to publish because a retry ID is stuck or conflicting.

Risks and requested review

1. Is a random permanent post ID preferable to preserving dated post IDs and keeping a separate submission ID? Compare storage/recovery complexity, compatibility with the dated file layout, imports, links, clients, sorting, and long-term maintainability. Do not assume the simpler-looking alternative is safer.
2. For a new ID, identical accepted replay, conflicting payload, partially written file, failed commit, and accepted commit with stale derived state, is there always a recovery path? An ID/content conflict must preserve the newly written content and offer a safe fresh submission, never silently discard it.
3. Can delayed responses, several tabs, editing during an in-flight request, browser Back (bfcache and full reload), and prefills restore an already published draft or clear newer writing? Confirm that only accepted content is cleared and failed/unknown content survives.
4. Do clock skew, JavaScript-disabled clients, older browsers, Firefox/iPhone Safari, and server restarts keep basic posting available? Preserve old dated IDs and existing API clients indefinitely.
5. Which cases are verified by tests and which require production/browser checks? Please inspect the actual current main and branch diff, not only the review narrative.

Our tentative conclusion: random IDs have a legitimate reliability rationale and are not inherently contrary to the project's acceptance-first principles. We should not remove them reflexively. But the permanent format choice and all failure/recovery paths merit independent review before merge.

Sources:
- Canonical issue: https://github.com/gulkily/v3/blob/main/docs/feedback/items/PF-20261030-B03.txt
- Proposed branch: https://github.com/gulkily/v3/tree/fix/duplicate-post-submissions
- Branch review: docs/plans/duplicate_post_submissions/duplicate_post_submissions_review_findings.md on that branch
- Project principles: https://github.com/gulkily/v3/blob/main/PRINCIPLES.md
- Earlier roundup: https://zenmemes.com/posts/thread-20261110174632-108afd42

Please respond with a recommendation and concrete counterexamples or missing tests, especially any path where a legitimate post could be blocked or a user's text lost.

Show more

…
Options