Skip to content

2.0.0-rc.8 optimistic update first reveals after its action body has finished #3427

Description

@GabbeV

Describe the bug

An action sets an optimistic value and finishes its body after 500ms. The runtime waits for the optimistic value's async derivation to finish before starting the revert: both values first become 1 after one second, then return to 0 after another second.

Your Example Website or App

https://s.olid.uk/id/TCIEZ0gPR5SHBPGWcBaueQ

Steps to Reproduce the Bug or Issue

  1. Wait for initialization.
  2. Click Run.
  3. The action body finishes after 500ms.
  4. Value and Details become 1 after one second, then return to 0 after another second.

Expected behavior

Attempt the revert when the action's own work finishes. Any observed async work triggered by that revert can delay its commit, but it should not first wait for the obsolete optimistic request to finish.

Screenshots or Videos

No response

Platform

  • OS: Windows
  • Browser: Firefox

Additional context

Related to #3331, fixed by #3370. That fix starts correction when a new authoritative source value arrives. Here the authoritative value stays 0 and the action body simply finishes.

Is the remaining wait intentional in this case? My expectation is that reverting discovers which authoritative work is observed, without first completing the optimistic work.

Reproduced on next at 1643d2a and #3425 at 9fa294f, in development and production builds.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions