Repository navigation
fix(notifications): show amount and title in payment request pushes - #1872
Merged
Merged
Conversation
A push for a payment-request widget carries only the request id, so the
notification kept the server's generic body, and in a private group a
stand-in because the request text is sealed.
Fetch the request (bounded to 5s like the avatar load), take the opened
title and the viewer's share (or the whole split), and post
"Requested $X for {title}". A failed or timed-out fetch, or a request
from another chat, keeps today's body.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A push for a payment request carries only the request id. The notification fell back to the server's generic body, and in a private group, where the request text is sealed, to a stand-in that names neither the amount nor the title.
NotificationServicenow spots aWidgetContent.PaymentRequestin the pushed message and fetches it throughPaymentRequests.fetch, which opens sealed titles. The fetch has a 5s limit, matching the avatar load. A new pureplanPaymentRequestBodybuilds the text: "Requested $X for {title}", "Requested $X", or "Sent request for {title}".MessagingStylealready shows the sender, so the text leaves the name out. The amount is the viewer's own share when they have one, otherwise the whole split.If the fetch fails or times out, or the request belongs to another chat, the body is the same as today. Tapping still opens the chat.
PaymentRequestBodyPlannerTestcovers the planner.