Skip to content

Commit

Permalink
adding log lines
Browse files Browse the repository at this point in the history
  • Loading branch information
danieldoglas committed Apr 10, 2024
1 parent 45268af commit 99eec24
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Onyx.connect({
export default function subscribeToReportCommentPushNotifications() {
PushNotification.onReceived(PushNotification.TYPE.REPORT_COMMENT, ({reportID, reportActionID, onyxData, lastUpdateID, previousUpdateID}) => {
if (!ActiveClientManager.isClientTheLeader()) {
Log.info(`[PushNotification] received report comment notification, but ignoring it since this is not the active client`);
Log.info('[PushNotification] received report comment notification, but ignoring it since this is not the active client');
return;
}
Log.info(`[PushNotification] received report comment notification in the ${Visibility.isVisible() ? 'foreground' : 'background'}`, false, {reportID, reportActionID});
Expand Down
7 changes: 6 additions & 1 deletion src/libs/actions/User.ts
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,7 @@ function subscribeToUserEvents() {
PusherUtils.subscribeToPrivateUserChannelEvent(Pusher.TYPE.MULTIPLE_EVENTS, currentUserAccountID.toString(), (pushJSON) => {
// If this is not the main client, we shouldn't process any data received from pusher.
if (!ActiveClientManager.isClientTheLeader()) {
Log.info('[Pusher] Received updates, but ignoring it since this is not the active client');
return;
}
// The data for the update is an object, containing updateIDs from the server and an array of onyx updates (this array is the same format as the original format above)
Expand All @@ -606,7 +607,11 @@ function subscribeToUserEvents() {
return SequentialQueue.getCurrentRequest().then(() => {
// If we don't have the currentUserAccountID (user is logged out) or this is not the
// main client we don't want to update Onyx with data from Pusher
if (currentUserAccountID === -1 || !ActiveClientManager.isClientTheLeader()) {
if (currentUserAccountID === -1) {
return;
}
if(!ActiveClientManager.isClientTheLeader()) {
Log.info('[Pusher] Received updates, but ignoring it since this is not the active client');
return;
}

Expand Down

0 comments on commit 99eec24

Please sign in to comment.