Skip to content

BugFix - Use File ID Instead of File Object for EditorWebView Argument Passing #14960

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

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

alperozturk96
Copy link
Collaborator

@alperozturk96 alperozturk96 commented Jun 6, 2025

  • Tests written, or not not needed

This PR fixes argument-passing logic to use the fileId (a Long) instead of the full OCFile object when navigating to EditorWebView and its subclasses.

Currently, RichDocumentsEditorWebView and TextEditorWebView extends from EditorWebView, which itself extends from ExternalSiteWebView, and it is also extends from FileActivity. Due to this inheritance chain, the onCreate methods of parent classes are executed before those of the child. As a result, any large OCFile object passed through an Intent will crash before FileActivity has the chance to handle it properly.

This issue arises because Android imposes a 1MB limit on Parcelable extras.

This PR resolves that by passing only the fileId, which is later used to retrieve the OCFile within FileActivity.

How to test?

  1. Create a new .md file in the app.
  2. Attempt to open and edit the file using the editor.

Copy link

github-actions bot commented Jun 6, 2025

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/14960.apk

qrcode

To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.

Copy link

github-actions bot commented Jun 6, 2025

Codacy

Lint

TypemasterPR
Warnings5151
Errors1111

SpotBugs

CategoryBaseNew
Bad practice6565
Correctness5859
Dodgy code292280
Experimental11
Internationalization77
Malicious code vulnerability11
Multithreaded correctness77
Performance5149
Security1818
Total500487

@alperozturk96
Copy link
Collaborator Author

alperozturk96 commented Jun 12, 2025

Additional detailed findings are required. For now, I have reverted this PR to draft.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Passing Full OCFile to EditorWebView May Exceed Parcelable Limit and Cause App Crash
1 participant