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

[Fix] grouping skipping opRepoPostCreateDelay, causing operations being applied out of order when multiple login operations are pending. (fixes issue since 5.1.10) #2087

Merged
merged 7 commits into from
May 16, 2024

Commits on May 14, 2024

  1. test proving grouping issue

    Added test to prove that grouping logic is not waiting on
    opRepoPostCreateDelay for new ids.This has side effect of operations
    being done out of order in some cases. A real world case is login
    operations can be done out of order, which also results in things like
    the push subscription being on the wrong users. There is also a smaller
    issue where we are simply not waiting the time limit so some 404 error
    were not being avoid but would have still resulted in correct behavior
    in the end.
    jkasten2 committed May 14, 2024
    Configuration menu
    Copy the full SHA
    38e5e6c View commit details
    Browse the repository at this point in the history
  2. OperationRepo.getGroupableOperations() was not respecting

    opRepoPostCreateDelay like OperationRepo.getNextOps(), this would lead
    to some being applied out of order. The only known case is when there
    is a login in the queue for an Anonymous User crate and also User A and
    another for User B. The anonymous User create happens first with a push
    subscription which is correct. Then we have to wait for
    opRepoPostCreateDelay time after that create before we can attempt to
    identify it has User A, this is also ok. However we skip to User B and
    try to create it and transfer the subscription, this isn't correct as
    we also should wait opRepoPostCreateDelay for the new subscription id.
    
    While this commit fixes the issue noted above there should be another
    mechanism in place to prevent such an issue. This should be done in a
    follow up commit.
    
    See PR #2087 for more details.
    jkasten2 committed May 14, 2024
    Configuration menu
    Copy the full SHA
    ee6e690 View commit details
    Browse the repository at this point in the history
  3. simply loadSavedOperations logic

    Reversing the list means we insert each item at index 0 to keep the
    order correct. Always inserting at index 0 means we no longer need to
    keep an index state, which both simples the code but also means we
    don't depend on state which may be wrong sometimes, noted in the
    warning comment that was removed in this commit. This reversed()
    logic for list used in a few places in this file already to solve this
    problem.
    jkasten2 committed May 14, 2024
    Configuration menu
    Copy the full SHA
    cc67b11 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    fa07f4f View commit details
    Browse the repository at this point in the history
  5. simplify mutableListOf

    jkasten2 committed May 14, 2024
    Configuration menu
    Copy the full SHA
    064db14 View commit details
    Browse the repository at this point in the history

Commits on May 15, 2024

  1. canAccess should be inclusive

    Since opRepoPostCreateDelay is passed to delay() canAccess() should use
    inclusive logic.
    jkasten2 committed May 15, 2024
    Configuration menu
    Copy the full SHA
    5d5c837 View commit details
    Browse the repository at this point in the history

Commits on May 16, 2024

  1. stall OperationRepo by opRepoPostCreateDelay

    The OperationRepo can't juggle two different users correctly, so
    stall the whole queue by opRepoPostCreateDelay. We plan to address this
    limitation in a future PR.
    jkasten2 committed May 16, 2024
    Configuration menu
    Copy the full SHA
    9f8afc0 View commit details
    Browse the repository at this point in the history