Skip to content
Snippets Groups Projects

Status posting Idempotency

Merged Shpuld Shpludson requested to merge feat/idempotency into develop
1 unresolved thread

Every time the currently composed status changes it updates the idempotency key with a timestamp, so it stays the same if the post status request fails, but changes every time user willingly changes the content in any way or the form is cleared after successful posting. Server won't let through statuses with the same idempotency key so this eliminates double posts when user thinks a status didn't go through and hits submit again without changes.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
665 666 form.append('preview', 'true')
666 667 }
667 668
669 let postHeaders = authHeaders(credentials)
  • Maintainer

    can be const

  • Author Maintainer

    true, it could due to how js's const is borderline useless with objects, let makes it clear that the data is getting mutated. it's mostly just a semantic and not a technical reason to use it here

  • Maintainer

    it could lead to different optimization by JS engine, anticipating that that reference to object might change

  • Author Maintainer

    not reason enough to change it, it's a local variable with a very short lifespan, assuming optimizations of the underlying VM and changing code because of completely unproven assumptions is a really bad practice

  • Please register or sign in to reply
  • Maintainer

    lgtm

  • Very nice!

  • merged

  • lain mentioned in commit 0ea23a03

    mentioned in commit 0ea23a03

  • Eugenij mentioned in issue #595 (closed)

    mentioned in issue #595 (closed)

  • feld mentioned in issue #760

    mentioned in issue #760

  • Please register or sign in to reply
    Loading