Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.43k stars 2.8k forks source link

[HOLD for payment 2024-07-10] [HOLD for payment 2024-07-02] LOW: [$500] Stop using `reportAction.originalMessage` or `reportAction.message.text` #39797

Closed quinthar closed 2 months ago

quinthar commented 6 months ago

Problem:

Each comment in the server database is stored in reportAction.message in HTML form. However, for some reason lost to time, when we send that same comment out as an Onyx update, we:

  1. Rename the original message in the database to reportAction.originalMessage in the update (which is confusing)
  2. Create a new message object that contains a copy of the html message, as well as a stripped text version.
  3. Put the message object inside a totally unnecessary one-element array

That means every comment is actually sent out three times (four, if you include the update to the report object, but that's out of scope for now). This is clearly wasteful in a number of ways:

  1. It requires postprocessing on the server to do this extraneous operation
  2. It increases network bandwidth by 3x
  3. It increases RAM use 3x
  4. It increases on-device storage 3x
  5. It's confusing AF

Additionally, it's particularly problematic when sending Onyx updates out via UrbanAirship, which is extremely limited in the payload sizes allowed -- with anything over a certain limit just dropped quietly and never delivered, causing "gaps" in our update stream (which require more network calls to "backfill" the Onyx data on app open, which makes things slow). Basically, this was just a mistake introduced for reasons we can't remember, but that we want to undo.

Solution:

To solve this, please:

  1. Phase 1 (External / clientside): Stop using originalMessage, start using array-message
    1. Update every instance of originalMessage.html to use message.html || message[0].html
    2. Update every instance of message.text to dynamically strip the text from message.html || message[0].html
    3. Update every key within originalMessage to use the original message
  2. Phase 2 (Internal / serverside): Once we've confirmed the client no longer uses originalMessage or message.text or any other key within originalMessage:
    1. Stop sending originalMessage
    2. Start sending message without an array
  3. Phase 3 (External / clientside): Remove checking for "array message"

This issue is for phase 1 and phase 3.

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01856d1399295ef760
  • Upwork Job ID: 1776729925881405440
  • Last Price Increase: 2024-07-12
  • Automatic offers:
    • cubuspl42 | Reviewer | 0
Issue OwnerCurrent Issue Owner: @puneetlath
muttmuure commented 3 months ago

Is this being worked on?

thienlnam commented 3 months ago

Still in review - pending a review from @roryabraham. Dropping my assignment since I'm not adding much value as a reviewer here

melvin-bot[bot] commented 3 months ago

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

melvin-bot[bot] commented 3 months ago

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

melvin-bot[bot] commented 3 months ago

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

melvin-bot[bot] commented 3 months ago

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

melvin-bot[bot] commented 3 months ago

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

melvin-bot[bot] commented 3 months ago

Reviewing label has been removed, please complete the "BugZero Checklist".

melvin-bot[bot] commented 3 months ago

The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.1-19 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-07-02. :confetti_ball:

For reference, here are some details about the assignees on this issue:

melvin-bot[bot] commented 3 months ago

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

melvin-bot[bot] commented 3 months ago

Payment Summary

Upwork Job

BugZero Checklist (@puneetlath)

puneetlath commented 3 months ago

@c3024 bump on the checklist so we can pay you. Can you also link me your Upwork profile so I can send you a job?

@nkdengineer Upwork offer here: https://www.upwork.com/nx/wm/offer/102963265. Ping me on the issue when you've accepted.

c3024 commented 3 months ago

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

c3024 commented 3 months ago

bump on the checklist so we can pay you.

Done

Can you also link me your Upwork profile so I can send you a job?

Here it is - https://www.upwork.com/freelancers/~0105555e2f227dbf47

Can the pay be bumped up here? This is a large PR touching many files and there were some big revisions as well. Thanks!

melvin-bot[bot] commented 3 months ago

The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.3-7 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-07-10. :confetti_ball:

For reference, here are some details about the assignees on this issue:

melvin-bot[bot] commented 3 months ago

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

melvin-bot[bot] commented 2 months ago

Payment Summary

Upwork Job

BugZero Checklist (@puneetlath)

melvin-bot[bot] commented 2 months ago

Upwork job price has been updated to $500

puneetlath commented 2 months ago

@nkdengineer please accept offer here: https://www.upwork.com/nx/wm/offer/103096930 @c3024 please accept offer here: https://www.upwork.com/nx/wm/offer/103096934

Both of you, please ping me on this issue when you've accepted.

c3024 commented 2 months ago

@puneetlath thanks, accepted!

puneetlath commented 2 months ago

@c3024 has been paid. Just waiting for you now @nkdengineer.

nkdengineer commented 2 months ago

@puneetlath Accepted thanks 🙇

puneetlath commented 2 months ago

All paid. Thanks everyone!