Fix: Sync Media Fail Notifications are expandable and copyable - #20976
Fix: Sync Media Fail Notifications are expandable and copyable#20976LUwUcifer wants to merge 2 commits into
Conversation
|
Second commit may not be fully optimised, requesting review |
b4b1ea1 to
aacfdcb
Compare
Describe that appropriately and/or send a video or screenshot |
|
bigText allows for display of the entire error message, copy to clipboard - copies to clipboard |
|
Hello 👋, this PR has had no activity for more than 2 weeks and needs a reply from the author. If you think this is a mistake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing! You have 7 days until this gets closed automatically |
|
This still has a flagged security vulnerability: https://github.com/ankidroid/Anki-Android/security/code-scanning/35 |
|
Hey david I saw that persisting error but couldn't figure out how to rectify it as other examples of usages of intent within the project follow the same syntax, I'll need some guidance on the same |
1c3d1a4 to
aacfdcb
Compare
acf305a to
dd26d8f
Compare
dd26d8f to
5aed42f
Compare
| private fun getCopyToClipboardIntent(text: String): PendingIntent { | ||
| val intent = | ||
| Intent(applicationContext, CopyToClipboardReceiver::class.java).apply { | ||
| putExtra(CopyToClipboardReceiver.EXTRA_SYNC_ERROR_LOG, text) |
There was a problem hiding this comment.
There's a limit to text, about 1MB, it needs to be checked and trimmed
There was a problem hiding this comment.
Would that issue ever arise given error messages are exclusively provided from the backend?
There was a problem hiding this comment.
Unlikely, most likely from a StackOverflowError
There was a problem hiding this comment.
I don't think this was handled
|
Hello 👋, this PR has had no activity for more than 2 weeks and needs a reply from the author. If you think this is a mistake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing! You have 7 days until this gets closed automatically |
|
Should be fine now, I didn't implement support for other languages/runes since I assume stacktrace will necessarily be in english, lmk if i should |
| ) | ||
| addAction( | ||
| R.drawable.baseline_content_copy_24, | ||
| with(applicationContext) { TR.sentenceCase.copyToClipboard }, |
There was a problem hiding this comment.
Why Application context over context?
| private fun getCopyToClipboardIntent(text: String): PendingIntent { | ||
| val intent = | ||
| Intent(applicationContext, CopyToClipboardReceiver::class.java).apply { | ||
| putExtra(CopyToClipboardReceiver.EXTRA_SYNC_ERROR_LOG, text) |
There was a problem hiding this comment.
I don't think this was handled
|
Hmm... Can't reopen this |
Includes review follow-ups from ankidroid#20976: an immutable PendingIntent, error text trimmed to fit the Binder transaction buffer, and regression tests Co-authored-by: David Allison <davidallisongithub@gmail.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Purpose / Description
SyncMediaWorker fail throwable notification could not be expanded or opened
Fixes
Approach
How Has This Been Tested?
Tested on local device
Learning (optional, can help others)
Checklist