Skip to content

Onyx.merge('key', null) breaks subsequent merges for 'key' #425

Closed

Description

@arosiclair

Codesandbox example

Rough steps:

  1. Init onyx
  2. Merge value on 'key'
  3. Merge null on 'key'
  4. Merge another value on 'key'
  5. See that 'key' never updates

This is reproducible on the latest version (v1.0.116) and at least as early as v1.0.100

The root of the problem seems to be here where a null change removes the key from Onyx but never clears the mergeQueue for the key. Subsequent merges just continue filling the queue without ever getting processed.

cc @chrispader since you're on the blame

Activity

  1. self-assigned this
    on Nov 10, 2023
  2. arosiclair commented on Nov 10, 2023

    @arosiclair
    ContributorAuthor

    Looks like this was introduced in v1.0.99 from this PR. cc @tgolen @neil-marcellini

  3. tgolen commented on Nov 13, 2023

    @tgolen
    Collaborator

    Thanks for digging into this and finding a problem @arosiclair. Let's be sure to start off with writing a test that reproduces the bug. @chrispader can you please look into this?

  4. chrispader commented on Nov 13, 2023

    @chrispader
    Contributor

    Yes, going to look into this either today or tomorrow! cc @arosiclair @tgolen

  5. chrispader commented on Nov 13, 2023

    @chrispader
    Contributor
  6. arosiclair commented on Nov 13, 2023

    @arosiclair
    ContributorAuthor

    Just merged it thanks for putting a fix out quickly!

  7. arosiclair commented on Nov 13, 2023

    @arosiclair
    ContributorAuthor

    @chrispader can you also post a PR to bump our version of Onyx in NewDot?

  8. chrispader commented on Nov 14, 2023

    @chrispader
    Contributor

    @chrispader can you also post a PR to bump our version of Onyx in NewDot?

    yes, will do 👍

  9. arosiclair commented on Dec 7, 2023

    @arosiclair
    ContributorAuthor

    This is all set!

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions