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: Inactive Clients Not Refreshing Action Buttons After App Deployment #34849

Merged

Conversation

Gustrb
Copy link
Contributor

@Gustrb Gustrb commented Dec 30, 2024

Proposed changes (including videos or screenshots)

Currently, when the app is redeployed, active clients properly fetch and display the updated action buttons (via GET /apps/actionButtons). However, any clients that were inactive during the deployment (e.g., a laptop in sleep mode) do not fetch the updated list upon becoming active again. As a result, these inactive clients continue using outdated actionIds, causing inconsistent and potentially broken interactions.

So now, everytime the client goes offline, we invalidate the cache, since the buttons might have changed in the meantime

Issue(s)

Steps to test or reproduce

Start with the client active and confirm it fetches updated action buttons upon deployment.
Put the client into an inactive state (e.g., close laptop lid or simulate a network disconnection), then redeploy the app.
Reactivate the client and verify that it immediately retrieves the updated action buttons list.
Repeat steps 2-3 for multiple clients to ensure consistent behavior across different endpoints and environments.

Note: You can use Meteor.disconnect to test socket reconnection

Further comments

CONN-434

Copy link
Contributor

dionisio-bot bot commented Dec 30, 2024

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

Copy link

changeset-bot bot commented Dec 30, 2024

🦋 Changeset detected

Latest commit: bb7bfa7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 35 packages
Name Type
@rocket.chat/meteor Patch
@rocket.chat/core-typings Patch
@rocket.chat/rest-typings Patch
@rocket.chat/uikit-playground Patch
@rocket.chat/api-client Patch
@rocket.chat/apps Patch
@rocket.chat/core-services Patch
@rocket.chat/cron Patch
@rocket.chat/ddp-client Patch
@rocket.chat/freeswitch Patch
@rocket.chat/fuselage-ui-kit Patch
@rocket.chat/gazzodown Patch
@rocket.chat/livechat Patch
@rocket.chat/model-typings Patch
@rocket.chat/ui-contexts Patch
@rocket.chat/account-service Patch
@rocket.chat/authorization-service Patch
@rocket.chat/ddp-streamer Patch
@rocket.chat/omnichannel-transcript Patch
@rocket.chat/presence-service Patch
@rocket.chat/queue-worker Patch
@rocket.chat/stream-hub-service Patch
@rocket.chat/license Patch
@rocket.chat/omnichannel-services Patch
@rocket.chat/pdf-worker Patch
@rocket.chat/presence Patch
rocketchat-services Patch
@rocket.chat/models Patch
@rocket.chat/network-broker Patch
@rocket.chat/ui-avatar Patch
@rocket.chat/ui-client Patch
@rocket.chat/ui-video-conf Patch
@rocket.chat/ui-voip Patch
@rocket.chat/web-ui-registration Patch
@rocket.chat/instance-status Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Gustrb Gustrb added this to the 7.3.0 milestone Dec 30, 2024
Copy link
Contributor

github-actions bot commented Dec 30, 2024

PR Preview Action v1.6.0

🚀 View preview at
https://RocketChat.github.io/Rocket.Chat/pr-preview/pr-34849/

Built to branch gh-pages at 2025-01-13 13:45 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@Gustrb Gustrb requested a review from tassoevan December 30, 2024 17:33
Copy link

codecov bot commented Dec 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 59.16%. Comparing base (0517a05) to head (bb7bfa7).
Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #34849      +/-   ##
===========================================
+ Coverage    59.12%   59.16%   +0.03%     
===========================================
  Files         2819     2819              
  Lines        67939    67779     -160     
  Branches     15134    15078      -56     
===========================================
- Hits         40172    40099      -73     
+ Misses       24934    24859      -75     
+ Partials      2833     2821      -12     
Flag Coverage Δ
unit 74.99% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@Gustrb Gustrb marked this pull request as ready for review December 30, 2024 19:32
@Gustrb Gustrb requested a review from a team as a code owner December 30, 2024 19:32
@Gustrb
Copy link
Contributor Author

Gustrb commented Jan 9, 2025

@Harmeet221 gave us her blessing on this one.

@Gustrb Gustrb added the stat: QA assured Means it has been tested and approved by a company insider label Jan 9, 2025
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Jan 9, 2025
@dionisio-bot dionisio-bot bot removed the stat: ready to merge PR tested and approved waiting for merge label Jan 9, 2025
apps/meteor/client/hooks/useAppActionButtons.ts Outdated Show resolved Hide resolved
@Gustrb Gustrb requested a review from gabriellsh January 10, 2025 11:51
@tassoevan tassoevan added stat: QA assured Means it has been tested and approved by a company insider and removed stat: QA assured Means it has been tested and approved by a company insider labels Jan 10, 2025
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Jan 10, 2025
@Gustrb Gustrb removed the request for review from gabriellsh January 13, 2025 13:14
@Gustrb Gustrb removed the stat: QA assured Means it has been tested and approved by a company insider label Jan 13, 2025
@dionisio-bot dionisio-bot bot removed the stat: ready to merge PR tested and approved waiting for merge label Jan 13, 2025
@Gustrb Gustrb added stat: ready to merge PR tested and approved waiting for merge stat: QA assured Means it has been tested and approved by a company insider labels Jan 13, 2025
@kodiakhq kodiakhq bot merged commit 88be133 into develop Jan 13, 2025
49 checks passed
@kodiakhq kodiakhq bot deleted the fix/invalidate-apps-buttons-cache-on-socket-reconnection branch January 13, 2025 14:24
This was referenced Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants