Skip to content

Conversation

@filipvnencak
Copy link
Collaborator

Description of changes

This PR fixes two related issues around default (base) views:

  1. Optimistic updates for base views were unreliable

    • In some cases, base view optimistic updates were skipped or left the cache in an inconsistent state.
    • Rollback logic was incomplete, causing stale cache data after failed mutations.
  2. Base view updates only worked on the Overview page

    • Updating the base view on other pages appeared to work but was not persisted correctly.
    • The logic mixed working view updates with base view persistence, causing the base view state to desync across pages.

The changes ensure that base view updates behave consistently and predictably across the application.

Technical details

  • Simplified optimistic update logic for getBaseView

    • Removed duplicated conditional update paths
    • Applied optimistic updates only when the cache is initialized
    • Ensured proper rollback (undo) handling for base view updates
  • Refactored BaseViewsTags

    • Centralized base view updates via onUpdateBaseView
    • Separated working view selection from base view persistence
    • Fixed base view updates not being saved outside the Overview page

Additional context

@filipvnencak filipvnencak self-assigned this Dec 22, 2025
@filipvnencak filipvnencak added the type: bug Something isn't working label Dec 22, 2025
@filipvnencak filipvnencak linked an issue Dec 22, 2025 that may be closed by this pull request
@filipvnencak filipvnencak requested a review from Innders December 22, 2025 11:19
Copy link
Member

@Innders Innders left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something has changed here... clicking on the base view is now updating the base view to the current view, overwriting the current base view. This is incorrect.

Clicking on the base view should:

  1. Set working view settings to the selected base view settings.
  2. Set your default (viewing) view to working.

projectName: arg.projectName,
})(state)
const newBaseView = {
id: `optimistic-base-${Date.now()}`,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason for this id format? If no could it please use uuid like other ids?

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

Labels

type: bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Default Views: Optimistic Updates Not Working

3 participants