Skip to content

fix(1660): added fix for access token not getting deleted#636

Merged
timbastin merged 2 commits intol3montree-dev:mainfrom
gauravshinde1816:fix/di-1660-fix-delete-access-token-and-manage-the-state-correctly
Feb 14, 2026
Merged

fix(1660): added fix for access token not getting deleted#636
timbastin merged 2 commits intol3montree-dev:mainfrom
gauravshinde1816:fix/di-1660-fix-delete-access-token-and-manage-the-state-correctly

Conversation

@gauravshinde1816
Copy link
Contributor

Issue Link :
l3montree-dev/devguard#1660

Changes Implemented

  • Fixed access token deletion bug: Resolved the issue where access tokens were not being properly deleted from the database.
  • Resolved stale state issue: After implementing the initial fix, I identified a secondary issue where the activeOrg state was not updating on the UI despite successful deletion from the database. The access token details persisted in the local component state.
  • Applied immediate fix: Resolved this by utilizing context state instead of prop-based state management. However, I've observed similar stale state issues in 2-3 other locations throughout the application. I will document these instances and create a separate issue to track them.

Recommendation for Future Improvement

I suggest migrating to a more robust state management solution such as Zustand. This would provide:

  • Centralized state management
  • Reduced occurrence of stale state issues
  • Improved developer experience and maintainability

This is a recommendation for consideration. I'm happy to discuss the approach and can research implementation strategies for improving state management across the project if the team is interested.
Please let me know your thoughts on this proposal.

  • Visual Changes:
issue_1660_ui.mp4

@gauravshinde1816
Copy link
Contributor Author

@Hubtrick-Git @timbastin
Can you please take a look into this PR

Thanks !!

@timbastin
Copy link
Member

@gauravshinde1816 Wow this is great! Thanks a lot for all that effort. There is only a single change needed: I think we do not need to close the dialog after deletion. Since the user is actually doing a provider setup, so deleting an old access token does not mean, he wants to stop setting up a different one. What do you think?

@gauravshinde1816
Copy link
Contributor Author

Sure @timbastin
This makes sense, I will do the changes , since user is doing the provider setup , we should redirect user to previous provider setup modal itself instead of closing the modal after deleting the key.

…closing modal

- Remove onClose prop from ProviderSetup component
- Update handleDelete to use api.scrollTo(prevIndex) instead of closing modal
- Remove onClose prop from RepositoryConnectionSlide wrapper
- Remove onClose prop from RiskScannerDialog usage

This ensures users can continue the integration setup flow after deletion
since integrations are being auto-setup.

Signed-off-by: gauravshinde1816@gmail.com
Signed-off-by: gauravshinde1816@gmail.com <gauravshinde1816@gmail.com>
@gauravshinde1816
Copy link
Contributor Author

Hey @timbastin
I have made the changes , Can you please check once
Thanks !!

issue_1660_revise.mp4

@timbastin
Copy link
Member

This is great! Thanks a lot!

@timbastin timbastin merged commit 1aa8b53 into l3montree-dev:main Feb 14, 2026
1 check passed
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.

2 participants