Skip to content

LF-5100 reset api state instead of invalidates tags#4086

Open
Duncan-Brain wants to merge 1 commit intointegrationfrom
LF-5100-reset-api-state-only
Open

LF-5100 reset api state instead of invalidates tags#4086
Duncan-Brain wants to merge 1 commit intointegrationfrom
LF-5100-reset-api-state-only

Conversation

@Duncan-Brain
Copy link
Copy Markdown
Collaborator

@Duncan-Brain Duncan-Brain commented Mar 12, 2026

Description

See discussions on #3988 . This makes the api work as we currently expect it to. However the shared constants are no longer stored between switching. See other PR for how to do that.

Right now every rtk endpoint is possible to show another farms data.

If an error occurs, another farms data could be shown.

If an endpoint takes a long time (sensors), another farms data could be shown.

isLoading is now differentiated between farms: https://stackoverflow.com/questions/75401477/reasons-for-using-isloading-or-isfetching-in-react-query

Jira link: LF-5100

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Passes test case
  • UI components visually reviewed on desktop view
  • UI components visually reviewed on mobile view
  • Other (please explain)

Checklist:

  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • The precommit and linting ran successfully
  • I have added or updated language tags for text that's part of the UI
  • I have ordered translation keys alphabetically (optional: run pnpm i18n to help with this)
  • I have added the GNU General Public License to all new files

yield call(axios.patch, patchStepUrl(farm_id, user_id), step, getHeader(user_id, farm_id));

// Clear old farm RTK Query data
yield put(invalidateTags([...FarmTags, ...FarmLibraryTags]));
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

If we go with the proof of concept of farm_id partition eventually. Invalidates tags line would be removed anyways.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant