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

[HOLD #227234] Receiving Notifications from chats sent months ago #13140

Closed
kavimuru opened this issue Nov 29, 2022 · 23 comments
Closed

[HOLD #227234] Receiving Notifications from chats sent months ago #13140

kavimuru opened this issue Nov 29, 2022 · 23 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Internal Requires API changes or must be handled by Expensify staff Needs Reproduction Reproducible steps needed

Comments

@kavimuru
Copy link

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Go to a chat with Gabi
  2. Start chatting

Expected Result:

Notifications received would be from our chats happening now

Actual Result:

Received notifications from chats received months ago. When I look at those chats they also show “Invalid Date”

Workaround:

unknown

Platform:

Where is this issue occurring?

  • Desktop App

Version Number: 1.2.30-0
Reproducible in staging?: Needs reproduction
Reproducible in production?: Needs reproduction
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos:
Screenshot 2022-11-29 at 5 21 54 PM
Screenshot 2022-11-28 at 4 41 38 PM

Expensify/Expensify Issue URL:
Issue reported by: @garrettmknight
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1669654070339909

View all open jobs on GitHub

@kavimuru kavimuru added Needs Reproduction Reproducible steps needed Bug Something is broken. Auto assigns a BugZero manager. labels Nov 29, 2022
@melvin-bot
Copy link

melvin-bot bot commented Nov 29, 2022

Triggered auto assignment to @dylanexpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@garrettmknight
Copy link
Contributor

Updated to v1.2.33-7, 'invalid date' persists:
Screenshot 2022-11-30 at 10 01 29 AM

@dylanexpensify
Copy link
Contributor

working on reproducing now

@dylanexpensify
Copy link
Contributor

@garrettmknight is this only with your chat with Gabi?

@garrettmknight
Copy link
Contributor

There's another chat with her that has the 'Invalid Date' text on the same day, but no others.

@garrettmknight
Copy link
Contributor

Happened to @RobertLadue as well:
Screenshot 2022-11-30 at 8 51 33 PM

@marcaaron
Copy link
Contributor

possible theory - something in the API layer changed and is sending an invalid action.created

We render the date here ->

const ReportActionItemDate = props => (
<Text style={[styles.chatItemMessageHeaderTimestamp]}>
{props.datetimeToCalendarTime(props.created)}
</Text>
);

So like the UI says it is probably invalid...

Seeing the browser notifications makes sense too since we use the created field to determine whether to show a notification. The created being invalid means the front end interprets it as "new"

App/src/libs/actions/Report.js

Lines 1330 to 1331 in 820e876

// If we are past the deadline to notify for this comment don't do it
if (moment.utc(moment(action.created).unix() * 1000).isBefore(moment.utc().subtract(10, 'seconds'))) {

IMO this is in part of a consequence of this issue (needs a better general design) and in part due to some API change that we haven't connected to this bug yet (which seems more urgent to solve).

@dylanexpensify
Copy link
Contributor

Ah very interesting @marcaaron. Should we put this on hold then while we work on the linked issue? Or can we work on this externally in the meantime?

@marcaaron
Copy link
Contributor

I don't think it should be on HOLD, no. It seems like an API change has triggered this and we should make this Internal so someone on the team can prioritize it.

@marcaaron marcaaron added the Internal Requires API changes or must be handled by Expensify staff label Dec 2, 2022
@melvin-bot melvin-bot bot added the Overdue label Dec 5, 2022
@dylanexpensify
Copy link
Contributor

Sounds good! Thanks!

@melvin-bot melvin-bot bot removed the Overdue label Dec 5, 2022
@arosiclair arosiclair self-assigned this Dec 6, 2022
@arosiclair
Copy link
Contributor

I'll take a stab at tracing where this API issue could be coming from

@dylanexpensify
Copy link
Contributor

Amazing, thanks @arosiclair !

@melvin-bot melvin-bot bot added the Overdue label Dec 9, 2022
@dylanexpensify
Copy link
Contributor

@arosiclair any update here?

@melvin-bot melvin-bot bot removed the Overdue label Dec 9, 2022
@arosiclair
Copy link
Contributor

Not sure where this could be coming from but here's what I've found so far.

Several months ago we started using timestamps with millisecond precision in this PR. At the time we weren't depending on the created timestamp very much. This was deployed on Aug 29th.

A couple weeks ago we changed logic on how we generate and use created timestamps in NewDot in this PR. These changes were deployed in v1.2.30 which matches the affected versions in the OP.

If these were breaking changes, I'd think old messages sent before the above deploys would have this Invalid Date issue but that isn't the case for me. I've also tried trimming off the millisecond portion of the created string to reproduce Invalid Dates in dev but that didn't cause any issues.

@luacmartins @roryabraham @tylerkaraszewski Any ideas if they (or anything else) might be the source of this issue?

It might also be worth running a CQ to find what the created timestamps on these report actions actually look like in the DB.

@melvin-bot melvin-bot bot added the Overdue label Dec 14, 2022
@dylanexpensify
Copy link
Contributor

dylanexpensify commented Dec 15, 2022

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Dec 15, 2022
@dylanexpensify
Copy link
Contributor

@arosiclair any updates by chance?

@melvin-bot melvin-bot bot removed the Overdue label Dec 19, 2022
@arosiclair
Copy link
Contributor

Only path forward I see is getting affected reportIDs and running a CQ to see what these invalid created values look like. That should give us a hint as to what the issue is.

@garrettmknight @RobertLadue @joekaufmanexpensify could you share the report IDs for the chats you guys experienced this Invalid Date issue? You can open the chat in web and grab the ID from the URL here

Screen Shot 2022-12-19 at 3 05 52 PM

@luacmartins
Copy link
Contributor

Sorry I completely missed the ping here. It seems like the PRs Andrew linked are probably the cause. I agree that we could run a CQ to get the created dates for those reports to see how we are storing the date and then fix it.

@joekaufmanexpensify
Copy link
Contributor

I know I did experience this issue at some point in the past, but I don't remember which report, and didn't record it. Sorry! For me, signing out and back in resolved the issue at the time.

@melvin-bot melvin-bot bot added the Overdue label Dec 22, 2022
@melvin-bot
Copy link

melvin-bot bot commented Dec 23, 2022

@arosiclair, @dylanexpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@arosiclair
Copy link
Contributor

No real updates atm. Signing out and back in resolving the issue suggests that Onyx might have had an invalid created value cached and the API was only able to replace it with a valid one after signing out and clearing Onyx.

Bumping @garrettmknight @RobertLadue for those report IDs

@melvin-bot melvin-bot bot removed the Overdue label Dec 26, 2022
@JmillsExpensify JmillsExpensify changed the title Receiving Notifications from chats sent months ago [HOLD #227234] Receiving Notifications from chats sent months ago Dec 27, 2022
@JmillsExpensify
Copy link

A couple of things:

  • Given the relation to sequence numbers PRs, I'm going to proactively add a HOLD on that project and simultaneously take this issue over (I'm the BZ person assigned and responsible for SQN bugs).

  • Let's still have @garrettmknight and @RobertLadue share their reportIDs when they are both back from vacay.

  • Even then, given that signing in and out resolves the issue, that indicates that this is temporary, so I could equally see the argument that we should close this for focus. Leaving that up to @arosiclair.

@arosiclair
Copy link
Contributor

Yeah let's just close this out for now as this may never come up again after sequence numbers is finished. If it does, we can just reopen and take another look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Internal Requires API changes or must be handled by Expensify staff Needs Reproduction Reproducible steps needed
Projects
None yet
Development

No branches or pull requests

8 participants