Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support optimistic concurrency control headers #3462

Draft
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

Torres-ssf
Copy link
Contributor

@Torres-ssf Torres-ssf commented Dec 9, 2024

Release notes

In this release, we:

  • TBD

Summary

flowchart TD
    %% Initialization
    A[Initialize LATEST_BLOCK_HEIGHT = 0] --> B[Set request header required block to be LATEST_BLOCK_HEIGHT]
    
    %% Send Request
    B --> C[Send Request]
    
    %% Response Handling
    C -->|Response: 200 OK| D[Extract CURRENT_BLOCK_HEIGHT from Response]
    C -->|Response: 412 Precondition Failed| E[Increment Retry Count]
    
    %% Update Latest Block Height
    D --> F[Is CURRENT_BLOCK_HEIGHT > LATEST_BLOCK_HEIGHT?]
    F -->|Yes| G[Update LATEST_BLOCK_HEIGHT]
    F -->|No| H[No Change]
    G --> I[Proceed with next operation/request]
    H --> I[Proceed with next operation/request]
    
    %% Handling 412 - Precondition Failed
    E -->|Retry Count < Max Retries| J(Wait and Retry)
    J --> C
    E -->|Retry Count >= Max Retries| K[Abort]
    
    %% End Conditions
    K --> O[End]
    I --> O[End]
Loading

Checklist

  • All changes are covered by tests (or not applicable)
  • All changes are documented (or not applicable)
  • I reviewed the entire PR myself (preferably, on GH UI)
  • I described all Breaking Changes (or there's none)

Copy link

vercel bot commented Dec 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
fuels-template ❌ Failed (Inspect) Dec 13, 2024 11:38pm
ts-docs ❌ Failed (Inspect) Dec 13, 2024 11:38pm
ts-docs-api ❌ Failed (Inspect) Dec 13, 2024 11:38pm

@Torres-ssf Torres-ssf self-assigned this Dec 9, 2024
@Torres-ssf Torres-ssf added the feat Issue is a feature label Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat Issue is a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Review and Add Special Headers for Optimistic Concurrency Control
1 participant