[GH-ISSUE #1542] SendIntent crashes on Android #1012

Closed
opened 2026-02-25 22:38:43 +03:00 by kerem · 8 comments
Owner

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

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
kerem 2026-02-25 22:38:43 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@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 💙

<!-- gh-comment-id:1939381146 --> @github-actions[bot] commented on GitHub (Feb 12, 2024): Hello :wave: 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 :blue_heart:
Author
Owner

@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.

<!-- gh-comment-id:1950298592 --> @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.
Author
Owner

@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.

<!-- gh-comment-id:2105944798 --> @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.
Author
Owner

@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?

<!-- gh-comment-id:2106253776 --> @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?
Author
Owner

@marcelklehr commented on GitHub (May 12, 2024):

Doesn't make more sense to check tree state after resume

Mh, not sure if there's an event for resume

<!-- gh-comment-id:2106271890 --> @marcelklehr commented on GitHub (May 12, 2024): > Doesn't make more sense to check tree state after resume Mh, not sure if there's an event for resume
Author
Owner

@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.

<!-- gh-comment-id:2106286025 --> @kolinger commented on GitHub (May 12, 2024): [Here they say](https://capacitorjs.com/docs/apis/app#api) `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.
Author
Owner

@marcelklehr commented on GitHub (May 12, 2024):

When floccus needs more than 10 seconds to do sync?

If you have a lot of changes it can take minutes.

<!-- gh-comment-id:2106303588 --> @marcelklehr commented on GitHub (May 12, 2024): > When floccus needs more than 10 seconds to do sync? If you have a lot of changes it can take minutes.
Author
Owner

@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.

<!-- gh-comment-id:2874657830 --> @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.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/floccus#1012
No description provided.