Skip to content

The error is not being cleared properly when a collection returns an empty list #1104

@utopyin

Description

@utopyin
  • I've validated the bug against the latest version of DB packages

Describe the bug
The error states of a query collection (collection.utils.errorCount, collection.utils.isError) are not being cleared when a collection returns an empty list.

To Reproduce

  1. Have a query collection throw an error
  2. Call collection.utils.clearError() to clear the error and trigger queryFn again
    -> when queryFn returns an empty list, the error states are not updated at all
    -> when queryFn returns a list with at least one item, then the collection error states are cleared properly

Expected behavior
When the queryFn returns an empty list, it should clear the error and show the data being empty.

  • OS: macOS
  • Browser: Helium (chromium)
  • Version: 0.7.9.1 (Official Build, Chromium 143.0.7499.169) (arm64)

Minimal repro
https://github.com/utopyin/db-error-not-clearing-when-empty

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