-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[$250] [Crashlytics] TaskQueue: Error with task : [Pusher] instance not found. Pusher.subscribe() most likely has been called before Pusher.init() #46119
Comments
Current assignee @CortneyOfstad is eligible for the Bug assigner, not assigning anyone new. |
@CortneyOfstad Huh... This is 4 days overdue. Who can take care of this? |
@TMisiukiewicz it was indicated on one of the other Crashlytic GHs that the logs are truncated. Any way you could pull up the full logs? Thanks! |
@CortneyOfstad Huh... This is 4 days overdue. Who can take care of this? |
can we change it to weekly? |
@CortneyOfstad this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks! |
@CortneyOfstad Still overdue 6 days?! Let's take care of this! |
@CortneyOfstad 8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it! |
Adjusting the frequency now! Sorry for the delay, as I was OoO! |
Not overdue 👍 |
Hi. I'm Olimpia from Callstack and I would like to work on this issue. |
Hey @CortneyOfstad! Here is a proposal to fix this error: Problem This error indicates that the Solution To solve this error, we need to make sure that Pusher instance initialization (Pusher.init()) is complete before any subscription calls are made. This can be done by adjusting the code to enforce the order in which Pusher.init must be completed before subscribeToUserEvents begin. This will ensure that all necessary setup steps are executed in the correct order. At the moment
if (!Navigation.isActiveRoute(ROUTES.SIGN_IN_MODAL)) {
// This means sign in in RHP was successful, so we can subscribe to user events
User.subscribeToUserEvents();
}
Pusher.init({
appKey: CONFIG.PUSHER.APP_KEY,
cluster: CONFIG.PUSHER.CLUSTER,
authEndpoint: `${CONFIG.EXPENSIFY.DEFAULT_API_ROOT}api/AuthenticatePusher?`,
}).then(() => {
User.subscribeToUserEvents();
}) But only in the second case the Pusher is initialized. This can be fixed by adding a helper function to initialize the Pusher and then calling the subscribe event and invoking it in the above two places. Git diff:
+function initializePusher() {
+ Pusher.init({
+ appKey: CONFIG.PUSHER.APP_KEY,
+ cluster: CONFIG.PUSHER.CLUSTER,
+ authEndpoint: `${CONFIG.EXPENSIFY.DEFAULT_API_ROOT}api/AuthenticatePusher?`,
+ }).then(() => {
+ User.subscribeToUserEvents();
+ });
+}
+
Onyx.connect({
key: ONYXKEYS.SESSION,
callback: (value) => {
@@ -122,7 +132,7 @@ Onyx.connect({
if (Navigation.isActiveRoute(ROUTES.SIGN_IN_MODAL)) {
// This means sign in in RHP was successful, so we can subscribe to user events
- User.subscribeToUserEvents();
+ initializePusher();
}
},
});
@@ -252,13 +262,7 @@ function AuthScreens({session, lastOpenedPublicRoomID, initialLastUpdateIDApplie
NetworkConnection.listenForReconnect();
NetworkConnection.onReconnect(handleNetworkReconnect);
PusherConnectionManager.init();
- Pusher.init({
- appKey: CONFIG.PUSHER.APP_KEY,
- cluster: CONFIG.PUSHER.CLUSTER,
- authEndpoint: `${CONFIG.EXPENSIFY.DEFAULT_API_ROOT}api/AuthenticatePusher?`,
- }).then(() => {
- User.subscribeToUserEvents();
- });
+ initializePusher(); |
Looks great! Let me get some additional eyes on this as well! |
Job added to Upwork: https://www.upwork.com/jobs/~0164ec71de125e22e3 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @ZhenjaHorbach ( |
@ZhenjaHorbach interested to hear your thoughts on the @OlimpiaZurek's proposal here! |
@CortneyOfstad |
@OlimpiaZurek I had only one concern Lines 90 to 95 in be97458
So in this case the proposal looks good to me 🎀👀🎀 C+ reviewed |
Triggered auto assignment to @srikarparsi, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
PR has not yet been deployed to production, so going to continue to keep an eye on this 👍 |
Looks like automation failed here, and this PR #48664 on 09/09. |
BugZero Checklist
NA
I'm not sure that regression tests are needed here |
Sorry for the delay here @ZhenjaHorbach! I sent you an offer in Upwork here. Let me know once you accept and I can get that paid ASAP. Thanks! |
No worries ! |
Payment Summary@ZhenjaHorbach — paid $250 via Upwork |
Coming from this GH — #45054 (comment)
Reported by @TMisiukiewicz
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @ZhenjaHorbachThe text was updated successfully, but these errors were encountered: