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

Fix function active/archived tab switching #1284

Merged
merged 2 commits into from
Apr 22, 2024
Merged

Conversation

goodoldneon
Copy link
Contributor

Description

Fix stale data when switching between active and archived functions

Type of change (choose one)

  • Chore (refactors, upgrades, etc.)
  • Bug fix (non-breaking change that fixes an issue)
  • Security fix (non-breaking change that fixes a potential vulnerability)
  • Docs
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality not to work as expected)

Checklist

  • I've linked any associated issues to this PR.
  • I've tested my own changes.

Check our Pull Request Guidelines

Copy link

vercel bot commented Apr 17, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 17, 2024 7:22pm

…v/[environmentSlug]/functions/useRows.ts

Co-authored-by: Tony Holdstock-Brown <tony@inngest.com>
Copy link
Member

@djfarrelly djfarrelly left a comment

Choose a reason for hiding this comment

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

Left a single question, but I can see how the existing change looks like a valid and correct fix!

return;
}

if (functionsRes.data.page.page > functionsData.lastPage) {
Copy link
Member

Choose a reason for hiding this comment

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

How does this know to setFunctionsData on only archived vs. not archived?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The data is cleared out when archived changes:
https://github.com/inngest/inngest/blob/main/ui/apps/dashboard/src/app/(organization-active)/(dashboard)/env/%5BenvironmentSlug%5D/functions/useRows.ts#L33

This whole hook needs to be refactored. It's probably the worst code I've written here

@goodoldneon goodoldneon requested a review from tonyhb April 22, 2024 18:02
@goodoldneon goodoldneon merged commit 8f152d1 into main Apr 22, 2024
7 checks passed
@goodoldneon goodoldneon deleted the fix-fn-archived-toggle branch April 22, 2024 18:03
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.

None yet

3 participants