App: [$500] [Teachers Unite!] Implement optimistic whisper message

After the volunteer referral flow (“I know a teacher”) is completed, we redirect the user to the public room. But if the user performs this action in offline mode, we’ll just display the chat report as loading (since we’ll persist the request, we will share the room anyway once the request has been made).

Given that’s the default offline behavior for public rooms (i.e. when the user opens the native app from a deep link), we’ll implement, as a follow-up, the optimistic whisper message to notify the user that at least something is happening.

Whisper message for the inviter/referrer:

"Hey @" + inviterDisplayName + "! Thanks for referring your friend " + firstName + " to <a href=\"https://www.expensify.org\" rel=\"noreferrer noopener\">Expensify.org</a> Teachers Unite. We have gone ahead and reached out to them! We'll continue to share any important announcements here to keep you in the loop about the campaign's impact. If you'd like to refer someone else, just click on Save The World in the app's main menu. Thanks for helping us to Save The World!"
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01ab3acade482df27d
  • Upwork Job ID: 1699130464263553024
  • Last Price Increase: 2024-02-15

About this issue

  • Original URL
  • State: closed
  • Created 10 months ago
  • Comments: 100 (68 by maintainers)

Most upvoted comments

Oops, I was focused on another wave7 item. @rezkiy37, let’s continue with this issue. We’re planning to add the STW button when the campaign is live, but meanwhile, let’s implement it, and you can access the page by adding the route /teachersunite to the URL in the browser.

@hoangzinh thanks for the proposal. When I created the issue I asked for help from the Callstack team first, appreciate your proactivity 🙇🏽

No update today, wrapping up other dailies, then I will continue with this one

Sorry no update, I’ve been focused on wave bugs

Moved to vip-vsb with priority Medium although it’s not part of Complex splits

Feel free to move this to vip-vsb if you’d like to prioritize this, though I don’t think it’s required for wave7 any longer.

No update, we’d need to implement first a way to test the TU flows without impacting the data in the real policy. I already created a couple of PRs to flip the constants and one of those has been merged.

Guys, I am having a vacation till the 4th January. So, I will be OOO within this period.

No update, but I’m retaking this one today or tomorrow.

Hi @rezkiy37, sorry for the delay here. I’ve been focused on other high-priority items. I plan to retake this one this week (or early next week).

Alright, the priority is really remaining the same, but we’re taking this off hold.

I’m asking in Slack about the priority of this issue

Yeah, good call, I will move it to weekly

Just to inform, I’ll be ooo for the next few days and we’ll be back on Monday, November 6th.

I have to inform that starting tomorrow I have a short vocation until next Monday (6.11.2023). Feel free to left any comments, I will address them. See you soon 😉

@marcochavezf, should we add “On Hold” to this issue?

Thanks for the change, I will be working on the backend changes to avoid the duplicate message. I will let you know when it’s ready

Hi @rezkiy37, yeah the proposal looks good, thanks! I think the only change we’d need to sync the frontend and backend is to send the reportActionID from the optimistic whisper message to the API command ReferTeachersUniteVolunteer as a parameter. Could you include that change so I can test the backend changes?

Also, can I ask you for a translation (ES) for the message?

Yes, and this brings an interesting point I haven’t considered. Do you know if we’re translating other optimistic whisper messages? Because we don’t support locale in the backend atm and we’re just generating this message in English, which could be a problem if the app is configured in Spanish and receives eventually the message in English. So I think we would need to modify the ReferTeachersUniteVolunteer API command to receive the whisper message from the client-side.

  1. Should be the whisper message interactive? I mean that in the https://github.com/Expensify/App/issues/26738#issue-1881048071 there are inserts with an account and link.

Yup, it should use the existing mention implementation which has the format <mention-user>@${accountEmail}</mention-user> if I recall correctly.

  1. Who should be a sender of the message? volunteer@expensify.org? If yes, can I hardcode login and display name of the sender?

Yup, you can try to “refer” a teacher with the URL posted in the previous comment and you will see the whisper that we send from the backend: Screenshot 2023-10-03 at 14 49 57

The idea is to create the same whisper optimistcally in the client-side instead of waiting for the server to send it

@marcochavezf, /teachersunite does not work for me 🧐

Screenshot 2023-09-29 at 15 16 29

Ah it should be the full relative route (without /r) https://staging.new.expensify.com/teachersunite

Yes, I think we can put this on hold for now while we figure out when we’ll be launch the Save the World flow. The tracking issue for the project is here: https://github.com/Expensify/Expensify/issues/223645