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

Applying filters to a table from a button click occasionally means you have to apply them twice before they work. #15544

Open
1 task done
ConorWebb96 opened this issue Feb 13, 2025 · 3 comments
Labels
avalanche OSS team bb-components bb-filtering Filtering data bug Something isn't working env - production Bug found in production frontend

Comments

@ConorWebb96
Copy link
Contributor

Checklist

  • I have searched budibase discussions and github issues to check if my issue already exists

Hosting

  • Self
    • Method: docker compose
    • Budibase Version: 3.4.6
    • App Version: 3.4.6

Describe the bug
Make sure to change the end dates in the data to the current day and later that week for the second one.

When applying filters to a table via a button action, sometimes you will need to double-click in order to see the change filter reflected in the UI.

If I use the exact same filters with a data provider. This double-click issue never happens.

To Reproduce
Steps to reproduce the behavior:

  1. Import the attached app
  2. Go to screen table
  3. Click on the buttons at the top a few times
  4. See every so often that the Ui in the table won't change and show the data that matches the filter.
  5. Check the screen data-provider
  6. The above issue never happens

Expected behavior
Filters should always be applied and shown in the UI.

App Export
planned dates-export-1739449612584.tar.gz

Additional Notes
The filters being applied look right whenever the payload within the network tab is checked. I do not see any difference between table and data providers.

@ConorWebb96 ConorWebb96 added avalanche OSS team bb-components bb-filtering Filtering data bug Something isn't working env - production Bug found in production frontend labels Feb 13, 2025
@aptkingston
Copy link
Member

This is just because of the way your buttons work - you're updating 2 fields in the button action, which causes 2 search requests back to back in the same instant (one when the first field updates, one when the second field does). This creates a race condition depending on which request finishes first. If the second request finishes first then this is when the results look wrong.

So there's isn't a bug here, but it's hard to achieve what you want without creating a race condition like this. You'd need to update both fields in the same button action to get around this which you obviously can't do at the moment. Or design this in a different way, like a single dropdown to pick "today" or "this week" which set's a value into state or something.

@aptkingston
Copy link
Member

I'll have a look to see if there's something I can do to try and get around this by trying to ignore the results of any searches which aren't the one that started last. The table handles this differently than the data provider as the provider is much simpler, but the table has a much larger set of reactive logic which fires when filters change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
avalanche OSS team bb-components bb-filtering Filtering data bug Something isn't working env - production Bug found in production frontend
Projects
None yet
Development

No branches or pull requests

2 participants