-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Markdown - Large code blocks are not displayed until user refreshes the page #3797
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
Comments
Triggered auto assignment to @HorusGoul ( |
Things that I've found:
Solutions to solve this problem: a. We could implement one of Pusher's suggestions. I'd implement (b) or (c) as preventive measures to avoid messages from getting lost during a conversation and then work in (a) until we are sure it works with any size. Once (a) is ready, we could remove (b) or (c) as an improvement. I think N7 could be great because the improvement is aligned with the need to send "long important messages" related to the business. Also, if you try to send a text with a size of 3.5kB, it won't be received in the other end because the payload size exceeds the 10kB limit. What do we include in it to make it almost 3 times bigger? Is all of that necessary? Invoking the @Expensify/engineering team: What solution would you pick? |
I believe we have support already for (c). If you look here, all of that code should be able to handle multiple "chunks" of a single pusher message that is sent over multiple requests. I don't exactly remember how that code works, but I think @johnmlee101 was the one that wrote and implemented most of it, so he could hopefully provide some more context for us. |
Cool! If there's already support in the app for this, the only thing left would be sending the messages in chunks from the server to the Pusher API. |
Yeah! For new versions of the apps we should be able to handle pusher requests (at least the ones used for Inbox Calls). There might be some API changes required to make sure this flow works (as we don't want to disrupt the mobile app for older version support), but should be straightforward. |
Should we open a new issue related to the API changes? We could also close this one as we don't need to change anything on the client-side. |
To clarify, we are currently not sending report comments in chunks and will start doing so? I'm curious how we can do this without breaking existing mobile clients (Expensify not Expensify.cash) who are not set up to process chunks (most important maybe being Concierge in the current app). Pusher implementation here is not set up for chunks (as the implementation predates the chunking change). It's hard to tell which client you are sending a message to or whether they can support chunking so the clearest way to achieve this is to send the events to a channel that we know can support the chunking. Maybe there's a better way since that will result in a ton of potentially unnecessary events? Maybe this is less of a concern as I'm not too sure what happens when a mobile client tries to handle a message that is chunked. Maybe we handle it gracefully and the message just doesn't appear? If so, then it's less of a concern. |
I don't think the old mobile app uses pusher at all, does it?
…On Thu, Jul 1, 2021 at 12:33 PM Marc Glasser ***@***.***> wrote:
There might be some API changes required to make sure this flow works (as
we don't want to disrupt the mobile app for older version support), but
should be straightforward.
To clarify, we are currently not sending report comments in chunks and
will start doing so? I'm curious how we can do this without breaking
existing mobile clients (Expensify not Expensify.cash) who are not set up
to process chunks (most important maybe being Concierge in the current
app). Pusher implementation here is not set up for chunks
<https://github.com/Expensify/Mobile-Expensify/blob/b733fc9fc66b69c9c558a821aa0eb9f4bc5c4d49/app/managers/PusherManager.js#L179-L184>
(as the implementation predates the chunking change).
It's hard to tell which client you are sending a message to or whether
they can support chunking so the clearest way to achieve this is to send
the events to a channel that we know can support the chunking. Maybe
there's a better way since that will result in a ton of potentially
unnecessary events?
Maybe this is less of a concern as I'm not too sure what happens when a
mobile client tries to handle a message that is chunked. Maybe we handle it
gracefully and the message just doesn't appear? If so, then it's less of a
concern.
—
You are receiving this because you are on a team that was mentioned.
Reply to this email directly, view it on GitHub
<#3797 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJMAB3KJQMUQ2TCCY6KX4TTVSYJFANCNFSM47QYVOWQ>
.
|
Linked the code where it is used above. But yes, realtime report comments, Concierge widget, etc |
Going to return this to the pool as it's not a priority right now. |
This issue has not been updated in over 15 days. eroding to Monthly issue. P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do! |
Is this still an issue? I was going to apply the export label but maybe we can close it |
@pecanoro I sent you a 1200 lines / 62000 characters code block and it worked for me without any refresh. Did it work for you? FWIW the app froze for like 5 seconds after hitting "send" but that's another problem... |
Adding external then! |
Removing myself as an assignee if this is just internal and in search of a technical volunteer. |
Hey guys, does anyone know if the order of events is guaranteed from Pusher? I mean, if I have 10 events, am I going to receive the last one as last for sure? If that's not the case, we may also need to change the implementation at App too. |
@johnmlee101 , I saw the implementation client->client. One way to make it send in chunks only to users using the new app would be to filter by Would that be bad? |
Can you elaborate what parts of the code you would want to change for this to work? I'm not sure if I get the question 😓 |
I was thinking of composing this if here: https://github.com/Expensify/Web-Expensify/blob/f87face9d5963e18603e5380765d588680ab741e/lib/Push/Service.php#L122 If the data is not from concierge (name uses prefix) and has > 10kb I'll break it to chunks and send the push. Else it will follow the same rules it has today. |
Ok, just saw that the |
I think you can definitely assume it WON'T come in order. It has to go from our PHP to Pusher's server to our client, and there is a lot of room there for things to get out of order. |
Will stop this for now to change to a Daily reported bug |
Back on it. |
Ok, the code is now implemented from PHP. The messages are arriving at Pusher. Will continue to work on this. |
Ok, found it and it's now working. @johnmlee101 , I'll create a new eventType called "chunked-reportComment" and "chunked-repportCommentEdit". Since we were never sending the push notifications when it was bigger than 10240, this would be the situation when we would use this format and apps that are prepared to receive that kind of event will work with it. If I use the same handle that we use today ( Do you see any other alternative here? |
@danieldoglas Whoops! This issue is 2 days overdue. Let's get this updated quick! |
Hmm, for backwards compatibility I think the prefix makes sense to me. Can't think of another solution at the moment? |
@danieldoglas Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
@danieldoglas Eep! 4 days overdue now. Issues have feelings too... |
Backend approved. Waiting for deploy to test new.E on prod and send that PR. |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Action Performed:
Expected Result:
Message with large code block is displayed
Actual Result:
Message is not displayed. User needs to reload the page sothe message is displayed.
Workaround:
User needs to refresh the page.
Platform:
Where is this issue occurring?
Web ✔️
iOS
Android
Desktop App
Mobile Web
Version Number: 1.0.74-0
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
Grabando.193.mp4
Expensify/Expensify Issue URL:
View all open jobs on Upwork
From @MonilBhavsar https://expensify.slack.com/archives/C01GTK53T8Q/p1624957028202800
The text was updated successfully, but these errors were encountered: