mirror of
https://github.com/floccusaddon/floccus.git
synced 2026-04-25 22:26:06 +03:00
[GH-ISSUE #1542] SendIntent crashes on Android #1012
Labels
No labels
browser-specific
bug
correctness issues
enhancement
feature: Google Drive
feature: Linkwarden
feature: git
feature: nextcloud-bookmarks
feature: tabs
feature: webdav
help wanted
native-app
priority: high
priority: low
priority: medium
pull-request
question
question
stale
upstream
waiting for more information
wontfix
🙁 Not following issue template
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/floccus#1012
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kolinger on GitHub (Feb 12, 2024).
Original GitHub issue: https://github.com/floccusaddon/floccus/issues/1542
Which version of floccus are you using?
5.0.7
Describe the Bug
Android app crashes here on
SendIntent.finish()https://github.com/floccusaddon/floccus/blob/develop/src/ui/views/native/AddBookmarkIntent.vue#L173
When new bookmark is saved via SendIntent/share to Floccus. The reason is that AndroidManifest.xml isn't inline with send-intent, it's missing activity that should handle the SendIntent and instead Floccus tries to handle SendIntent itself and thus crashes - this is outline in send-intent documentation: https://github.com/carsten-klaffke/send-intent?tab=readme-ov-file#android
Apart of that Send intent doesn't work properly, it doesn't auto sync, it seems buggy overall. For example most of the time added bookmark doesn't propagate into the tree unless floccus is restarted. The communication between SendIndent and main activity doesn't seem to work right.
Expected Behavior
No crash
To Reproduce
Share URL to Floccus
@github-actions[bot] commented on GitHub (Feb 12, 2024):
Hello 👋
Thank you for taking the time to open this issue with floccus. I know it's frustrating when software
causes problems. You have made the right choice to come here and open an issue to make sure your problem gets looked at
and if possible solved.
I'm Marcel and I created floccus and have been maintaining it ever since.
I currently work for Nextcloud which leaves me with less time for side projects like this one
than I used to have.
I still try to answer all issues and if possible fix all bugs here, but it sometimes takes a while until I get to it.
Until then, please be patient.
Note also that GitHub is a place where people meet to make software better together. Nobody here is under any obligation
to help you, solve your problems or deliver on any expectations or demands you may have, but if enough people come together we can
collaborate to make this software better. For everyone.
Thus, if you can, you could also have a look at other issues to see whether you can help other people with your knowledge
and experience. If you have coding experience it would also be awesome if you could step up to dive into the code and
try to fix the odd bug yourself. Everyone will be thankful for extra helping hands!
One last word: If you feel, at any point, like you need to vent, this is not the place for it; you can go to the forum,
to twitter or somewhere else. But this is a technical issue tracker, so please make sure to
focus on the tech and keep your opinions to yourself.
I look forward to working with you on this issue
Cheers 💙
@kolinger commented on GitHub (Feb 17, 2024):
If I fix the crash (declaring extra activity in AndroidManifest as per send-intent readme) and neutralize SendIntent.finish() then bookmark gets added reliably into the tree and auto sync works too but of course now floccus stays open and send intent is never finished. Also the floccus I see isn't the actual floccus that's the activity of send intent and thus if this activity exits then main activity resumes and doesn't see new bookmark/changes, quite confusing. This makes sense since finish() exits the activity that handled the intent and if finish() is removed then the activity continues and can do everything but that's not correct then two floccuses exist at the same time. If fininish() is called then added bookmark isn't visible the same way in main activity.
There should be some kind of mechanism to make sure bookmark is saved before finish() is called. Also not sure how to handle auto sync in this instance since the activity exits and doesn't have time to handle auto sync as usual. I guess the proper way would be handling sync in background and signal the background task to do sync and then intent can exit peacefully or just wait for AlarmManager to trigged periodic sync - not ideal that could take ages.
There needs to be a check if tree was changed in background since as of now main activity thinks the tree didn't change when it was modified by send intent activity and shows old render of the tree and also synces old version of the tree until floccus is restarted.
The crash makes it seem like it's working more properly since it kills the main activity and forces to reload the tree when floccus is next activated but of course then auto sync doesn't have chance to run since floccus is crashed. If the crash is fixed then send intent gets it's own activity as it should and then the synchronization between main activity issue arises.
This reflects pretty much my user experience that sync doesn't happen after using Send intent unless I manually open floccus and periodic sync will also never occur even if I wait days since main activity of floccus is crashed thus AlarmManager never gets triggered.
@marcelklehr commented on GitHub (May 11, 2024):
Capacitorjs has a background runner API but it's limited to 30s on iOS which is too little time sadly.
I think fixing the crash and going back to the sharer App is a good enough solution for now. If people want to sync, they'll need to remember to open floccus. I'll add a regular interval to reload the current tree in the main screen so the changes from the share intent will be reflected.
@kolinger commented on GitHub (May 12, 2024):
30 seconds sound like long time. When floccus needs more than 10 seconds to do sync? I would think typical sync is couple seconds with reasonable connection to the server and 10 seconds or more only with bad connection and timeouts. Although background task is maybe too much work just for this, not sure since I have experience only with Android not Capacitor.
I guess if there isn't auto-sync action then AlarmManager should sync it eventually even without opening floccus again?
Doesn't make more sense to check tree state after resume and do tree reload then instead of time interval?
@marcelklehr commented on GitHub (May 12, 2024):
Mh, not sure if there's an event for resume
@kolinger commented on GitHub (May 12, 2024):
Here they say
addListener('resume', ...)? I would assume there needs to be some way to get pause/resume events since those are must have - not sure how would people live without them.@marcelklehr commented on GitHub (May 12, 2024):
If you have a lot of changes it can take minutes.
@github-actions[bot] commented on GitHub (May 13, 2025):
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.