astubenbord / paperless-mobile

An (almost) fully fledged mobile paperless client.
GNU General Public License v3.0
705 stars 36 forks source link

[Bug]: "Save Changes" of Document doesn't respond (But does save changes) #324

Closed rajalreadytaken closed 10 months ago

rajalreadytaken commented 10 months ago

What happened?

When editing an existing document and clicking "Save Changes" the screen does not respond. The changes actually are saved, but the app does not do anything after saving. When clicking the back button, it warns about discarding changes before saving.

Steps to reproduce

  1. Make a change to a document in the mobile app (ie: add or remove a tag)
  2. Click "Save changes" but nothing happens and screen stays the same in the "Edit Document" screen.
  3. Check the paperless-ngx web interface and the changes made in the mobile app actually ARE reflected in the document
  4. Press the "back" arrow in the mobile app, and it warns about discarding changes
  5. Viewing the document in the mobile app does not reflect changes until view is refreshed.

Log output from the app

No response

Screenshots

No response

Paperless-ng*x Version

2.1.1

Paperless-Mobile Version

3.1.4

Device

Google Pixel 7

Operating System Version

Android 14

Device Locale

Canada

Selected Locale

English (US)

Additional Context

No response

duesenklipper commented 10 months ago

Exact same behavior on my phone.

OnePlus 8 Pro Android 13 Paperless Mobile 3.1.4+58 Paperless-ngx 2.1.3

lagset commented 10 months ago

Can confirm: Pixel 8 Android 14 paperless-ngx 2.1.1 paperless-mobile 3.1.5

bjornbostrom commented 10 months ago

Hi Having the same problem on my S21 Ultra (android 14). I'll try to pull out some logs later...

astubenbord commented 10 months ago

Yeah, I really need some logs, I still cannot reproduce this.

rajalreadytaken commented 10 months ago

Yeah, I really need some logs, I still cannot reproduce this.

Hopefully I'm doing this right. First time doing it. Logcat output, filtered only lines with the word "paperless"

12-17 10:24:02.947 1790 3470 I ActivityTaskManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=de.astubenbord.paperless_mobile/.MainActivity bnds=[304,1698][540,1955]} with LAUNCH_SINGLE_TASK from uid 10241 (BAL_ALLOW_ALLOWLISTED_COMPONENT) result code=2 12-17 10:24:02.948 2513 2552 V WindowManagerShell: Transition requested: android.os.BinderProxy@8a4cb89 TransitionRequestInfo { type = OPEN, triggerTask = TaskInfo{userId=0 taskId=24969 displayId=0 isRunning=true baseIntent=Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=de.astubenbord.paperless_mobile/.MainActivity } baseActivity=ComponentInfo{de.astubenbord.paperless_mobile/de.astubenbord.paperless_mobile.MainActivity} topActivity=ComponentInfo{de.astubenbord.paperless_mobile/de.astubenbord.paperless_mobile.MainActivity} origActivity=null realActivity=ComponentInfo{de.astubenbord.paperless_mobile/de.astubenbord.paperless_mobile.MainActivity} numActivities=1 lastActiveTime=757050028 supportsMultiWindow=true resizeMode=1 isResizeable=true minWidth=-1 minHeight=-1 defaultMinSize=220 token=WCT{android.window.IWindowContainerToken$Stub$Proxy@924978e} topActivityType=1 pictureInPictureParams=null shouldDockBigOverlays=false launchIntoPipHostTaskId=-1 lastParentTaskIdBeforePip=-1 displayCutoutSafeInsets=Rect(0, 136 - 0, 0) topActivityInfo=ActivityInfo{95fbaf de.astubenbord.paperless_mobile.MainActivity} launchCookies=[] positionInParent=Point(0, 0) parentTaskId=-1 isFocused=true isVisible=false isVisibleRequested=false isSleeping=false topActivityInSizeCompat=false topActivityEligibleForLetterboxEducation= false topActivityLetterboxed= false isFromDoubleTap= false topActivityLetterboxVerticalPosition= -1 topActivityLetterboxHorizontalPosition= -1 topActivityLetterboxWidth=-1 topActivityLetterboxHeight=-1 locusId=null displayAreaFeatureId=1 cameraCompatControlState=hidden}, remoteTransition = null, displayChange = null } 12-17 10:24:02.952 2513 2552 D WindowManagerShell: onActivityRestartAttempt: ComponentInfo{de.astubenbord.paperless_mobile/de.astubenbord.paperless_mobile.MainActivity} 12-17 10:24:02.956 1790 2051 D ActivityManager: sync unfroze 15109 de.astubenbord.paperless_mobile for 1 12-17 10:24:02.966 1790 2048 V WindowManager: Sent Transition #7302 createdAt=12-17 10:24:02.938 via request=TransitionRequestInfo { type = OPEN, triggerTask = TaskInfo{userId=0 taskId=24969 displayId=0 isRunning=true baseIntent=Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=de.astubenbord.paperless_mobile/.MainActivity } baseActivity=ComponentInfo{de.astubenbord.paperless_mobile/de.astubenbord.paperless_mobile.MainActivity} topActivity=ComponentInfo{de.astubenbord.paperless_mobile/de.astubenbord.paperless_mobile.MainActivity} origActivity=null realActivity=ComponentInfo{de.astubenbord.paperless_mobile/de.astubenbord.paperless_mobile.MainActivity} numActivities=1 lastActiveTime=757050028 supportsMultiWindow=true resizeMode=1 isResizeable=true minWidth=-1 minHeight=-1 defaultMinSize=220 token=WCT{RemoteToken{1dd1df7 Task{cfc757a #24969 type=standard A=10659:de.astubenbord.paperless_mobile}}} topActivityType=1 pictureInPictureParams=null shouldDockBigOverlays=false launchIntoPipHostTaskId=-1 lastParentTaskIdBeforePip=-1 displayCutoutSafeInsets=Rect(0, 136 - 0, 0) topActivityInfo=ActivityInfo{e513464 de.astubenbord.paperless_mobile.MainActivity} launchCookies=[] positionInParent=Point(0, 0) parentTaskId=-1 isFocused=true isVisible=false isVisibleRequested=false isSleeping=false topActivityInSizeCompat=false topActivityEligibleForLetterboxEducation= false topActivityLetterboxed= false isFromDoubleTap= false topActivityLetterboxVerticalPosition= -1 topActivityLetterboxHorizontalPosition= -1 topActivityLetterboxWidth=-1 topActivityLetterboxHeight=-1 locusId=null displayAreaFeatureId=1 cameraCompatControlState=hidden}, remoteTransition = null, displayChange = null } 12-17 10:24:02.966 1790 2048 V WindowManager: info={id=7302 t=OPEN f=0x0 trk=0 r=[0@Point(0, 0)] c=[{WCT{RemoteToken{1dd1df7 Task{cfc757a #24969 type=standard A=10659:de.astubenbord.paperless_mobile}}} m=TO_FRONT f=MOVE_TO_TOP leash=Surface(name=Task=24969)/@0xfe4eb1b sb=Rect(0, 0 - 1080, 2400) eb=Rect(0, 0 - 1080, 2400) d=0},{WCT{RemoteToken{b881849 Task{ca447ca #24963 type=home}}} m=TO_BACK f=SHOW_WALLPAPER leash=Surface(name=Task=24963)/@0xab587e4 sb=Rect(0, 0 - 1080, 2400) eb=Rect(0, 0 - 1080, 2400) d=0}]} 12-17 10:24:03.075 1790 5267 I ImeTracker: de.astubenbord.paperless_mobile:4dcc4507: onRequestHide at ORIGIN_SERVER_HIDE_INPUT reason HIDE_UNSPECIFIED_WINDOW 12-17 10:24:03.075 1790 5267 I ImeTracker: de.astubenbord.paperless_mobile:4dcc4507: onCancelled at PHASE_SERVER_SHOULD_HIDE 12-17 10:24:03.077 28454 28454 I GoogleInputMethodService: GoogleInputMethodService.onStartInput():1894 onStartInput(EditorInfo{EditorInfo{packageName=de.astubenbord.paperless_mobile, inputType=0, inputTypeString=NULL, enableLearning=false, autoCorrection=false, autoComplete=false, imeOptions=0, privateImeOptions=null, actionName=UNSPECIFIED, actionLabel=null, initialSelStart=-1, initialSelEnd=-1, initialCapsMode=0, label=null, fieldId=0, fieldName=null, extras=null, hintText=null, hintLocales=[]}}, false) 12-17 10:24:03.102 590 29244 W gralloc4: Unable to set buffer name SurfaceView[de.astubenbord.paperless_mobile/de.astubenbord.paperless_mobile.MainActivity]#3(BLAST Consumer)3: File name too long 12-17 10:24:03.111 590 29244 W gralloc4: Unable to set buffer name SurfaceView[de.astubenbord.paperless_mobile/de.astubenbord.paperless_mobile.MainActivity]#3(BLAST Consumer)3: File name too long 12-17 10:24:11.089 1790 2069 I InputDispatcher: Channel [Gesture Monitor] swipe-up (server) is stealing touch from [8d437f2 de.astubenbord.paperless_mobile/de.astubenbord.paperless_mobile.MainActivity (server), [Gesture Monitor] edge-swipe (server)] 12-17 10:24:11.123 1790 2048 V WindowManager: info={id=7303 t=TO_FRONT f=0x80 trk=0 r=[0@Point(0, 0)] c=[{WCT{RemoteToken{1ac4187 Task{c21860b #24334 type=recents I=com.google.android.apps.nexuslauncher/com.android.quickstep.RecentsActivity}}} m=TO_FRONT f=SHOW_WALLPAPER|MOVE_TO_TOP leash=Surface(name=Task=24334)/@0x56fef8f sb=Rect(0, 0 - 1080, 2400) eb=Rect(0, 0 - 1080, 2400) d=0},{WCT{RemoteToken{1dd1df7 Task{cfc757a #24969 type=standard A=10659:de.astubenbord.paperless_mobile}}} m=TO_BACK f=NONE leash=Surface(name=Task=24969)/@0xfe4eb1b sb=Rect(0, 0 - 1080, 2400) eb=Rect(0, 0 - 1080, 2400) d=0},{null m=TO_FRONT f=IS_WALLPAPER leash=Surface(name=WallpaperWindowToken{4c90288 token=android.os.Binder@9607e2b})/@0x2e06eee sb=Rect(0, 0 - 1080, 2400) eb=Rect(0, 0 - 1080, 2400) d=0}]} 12-17 10:24:11.177 590 29244 W gralloc4: Unable to set buffer name SurfaceView[de.astubenbord.paperless_mobile/de.astubenbord.paperless_mobile.MainActivity]#3(BLAST Consumer)3: File name too long 12-17 10:24:32.599 1790 2143 I ImeTracker: de.astubenbord.paperless_mobile:561eaf4b: onRequestHide at ORIGIN_SERVER_HIDE_INPUT reason HIDE_SAME_WINDOW_FOCUSED_WITHOUT_EDITOR 12-17 10:24:32.599 1790 2143 I ImeTracker: de.astubenbord.paperless_mobile:561eaf4b: onCancelled at PHASE_SERVER_SHOULD_HIDE 12-17 10:24:32.601 28454 28454 I GoogleInputMethodService: GoogleInputMethodService.onStartInput():1894 onStartInput(EditorInfo{EditorInfo{packageName=de.astubenbord.paperless_mobile, inputType=0, inputTypeString=NULL, enableLearning=false, autoCorrection=false, autoComplete=false, imeOptions=0, privateImeOptions=null, actionName=UNSPECIFIED, actionLabel=null, initialSelStart=-1, initialSelEnd=-1, initialCapsMode=0, label=null, fieldId=0, fieldName=null, extras=null, hintText=null, hintLocales=[]}}, false) 12-17 10:24:38.772 590 29244 W gralloc4: Unable to set buffer name SurfaceView[de.astubenbord.paperless_mobile/de.astubenbord.paperless_mobile.MainActivity]#3(BLAST Consumer)3: File name too long 12-17 10:24:46.882 15109 15109 D pdf_renderer: OpenDataDocument. Created file: /data/user/0/de.astubenbord.paperless_mobile/cache/87a09611de6f407882fbcca567cbf512.pdf 12-17 10:24:46.882 15109 15109 D pdf_renderer: OpenFileDocument. File: /data/user/0/de.astubenbord.paperless_mobile/cache/87a09611de6f407882fbcca567cbf512.pdf

astubenbord commented 10 months ago

Not exactly :D The app has its own set of logs which you can view, download and copy in Settings > App Logs :) That would be much more helpful!

rajalreadytaken commented 10 months ago

Not exactly :D The app has its own set of logs which you can view, download and copy in Settings > App Logs :) That would be much more helpful!

Lol sorry! Did that, seems much less detailed. Not sure if I'm doing it wrong.

2023-12-17 09:39:56.190 DEBUG --- [ AuthenticationCubit] - restoreSession : Trying to restore previous session... 2023-12-17 09:39:56.190 DEBUG --- [ AuthenticationCubit] - restoreSession : Reading encrypted credentials... 2023-12-17 09:39:56.192 INFO --- [ ] - : Setting refresh rate to 90.0 2023-12-17 09:39:56.303 DEBUG --- [ AuthenticationCubit] - restoreSession : Credentials successfully retrieved. 2023-12-17 09:39:56.303 DEBUG --- [ AuthenticationCubit] - restoreSession : Updating security context... 2023-12-17 09:39:56.303 DEBUG --- [ AuthenticationCubit] - restoreSession : Security context successfully updated. 2023-12-17 09:39:56.447 DEBUG --- [ AuthenticationCubit] - restoreSession : Trying to update remote paperless user... 2023-12-17 09:39:56.448 DEBUG --- [ AuthenticationCubit] - _getApiVersion : Trying to fetch API version... 2023-12-17 09:39:56.500 DEBUG --- [ AuthenticationCubit] - _getApiVersion : Successfully retrieved API version (3). 2023-12-17 09:39:56.501 DEBUG --- [ AuthenticationCubit] - _updateRemoteUser : Trying to update remote user object... 2023-12-17 09:39:56.568 DEBUG --- [ AuthenticationCubit] - _updateRemoteUser : Successfully updated remote user object. 2023-12-17 09:39:56.568 DEBUG --- [ AuthenticationCubit] - restoreSession : Successfully updated remote paperless user. 2023-12-17 09:39:56.570 DEBUG --- [ AuthenticationCubit] - restoreSession : Previous session successfully restored. 2023-12-17 09:39:56.603 INFO --- [ InboxCubit] - refreshItemsInInboxCount : Checking for new documents in inbox... 2023-12-17 09:39:56.839 INFO --- [ InboxCubit] - refreshItemsInInboxCount : No new documents found in inbox. 2023-12-17 09:40:26.611 INFO --- [ InboxCubit] - refreshItemsInInboxCount : Checking for new documents in inbox... 2023-12-17 09:40:26.668 INFO --- [ InboxCubit] - refreshItemsInInboxCount : No new documents found in inbox. 2023-12-17 10:25:02.603 INFO --- [ InboxCubit] - refreshItemsInInboxCount : Checking for new documents in inbox... 2023-12-17 10:25:02.673 INFO --- [ InboxCubit] - refreshItemsInInboxCount : No new documents found in inbox. 2023-12-17 10:25:32.616 INFO --- [ InboxCubit] - refreshItemsInInboxCount : Checking for new documents in inbox... 2023-12-17 10:25:32.705 INFO --- [ InboxCubit] - refreshItemsInInboxCount : No new documents found in inbox. 2023-12-17 10:40:25.923 INFO --- [ InboxCubit] - refreshItemsInInboxCount : Checking for new documents in inbox... 2023-12-17 10:40:26.013 INFO --- [ InboxCubit] - refreshItemsInInboxCount : No new documents found in inbox. 2023-12-17 10:40:55.923 INFO --- [ InboxCubit] - refreshItemsInInboxCount : Checking for new documents in inbox... 2023-12-17 10:40:55.965 INFO --- [ InboxCubit] - refreshItemsInInboxCount : No new documents found in inbox. 2023-12-17 10:41:25.922 INFO --- [ InboxCubit] - refreshItemsInInboxCount : Checking for new documents in inbox... 2023-12-17 10:41:26.036 INFO --- [ InboxCubit] - refreshItemsInInboxCount : No new documents found in inbox.

astubenbord commented 10 months ago

Are you running v3.1.5? Also, did you perform the action (update the document) and then copy the logs? The details is fine, every uncaught error should get logged here. I just skimmed over the logs you previously included and they're mostly system logs (e.g. when opening the keyboard). So nothing of interest really ^^ Also, you get a better filtered log when running adb logcat | grep flutter instead of paperless :)

rajalreadytaken commented 10 months ago

Ah I'm still on 3.1.4. I'll update now.

I did perform the actions, which is why I found it strange that the app logs just showed the refresh actions and that's it. I'll post logs again in a few minutes after updating.

rajalreadytaken commented 10 months ago

App logs. Let me know if you want logcat again.

2023-12-17 09:39:56.190 DEBUG --- [ AuthenticationCubit] - restoreSession : Trying to restore previous session... 2023-12-17 09:39:56.190 DEBUG --- [ AuthenticationCubit] - restoreSession : Reading encrypted credentials... 2023-12-17 09:39:56.192 INFO --- [ ] - : Setting refresh rate to 90.0 2023-12-17 09:39:56.303 DEBUG --- [ AuthenticationCubit] - restoreSession : Credentials successfully retrieved. 2023-12-17 09:39:56.303 DEBUG --- [ AuthenticationCubit] - restoreSession : Updating security context... 2023-12-17 09:39:56.303 DEBUG --- [ AuthenticationCubit] - restoreSession : Security context successfully updated. 2023-12-17 09:39:56.447 DEBUG --- [ AuthenticationCubit] - restoreSession : Trying to update remote paperless user... 2023-12-17 09:39:56.448 DEBUG --- [ AuthenticationCubit] - _getApiVersion : Trying to fetch API version... 2023-12-17 09:39:56.500 DEBUG --- [ AuthenticationCubit] - _getApiVersion : Successfully retrieved API version (3). 2023-12-17 09:39:56.501 DEBUG --- [ AuthenticationCubit] - _updateRemoteUser : Trying to update remote user object... 2023-12-17 09:39:56.568 DEBUG --- [ AuthenticationCubit] - _updateRemoteUser : Successfully updated remote user object. 2023-12-17 09:39:56.568 DEBUG --- [ AuthenticationCubit] - restoreSession : Successfully updated remote paperless user. 2023-12-17 09:39:56.570 DEBUG --- [ AuthenticationCubit] - restoreSession : Previous session successfully restored. 2023-12-17 09:39:56.603 INFO --- [ InboxCubit] - refreshItemsInInboxCount : Checking for new documents in inbox... 2023-12-17 09:39:56.839 INFO --- [ InboxCubit] - refreshItemsInInboxCount : No new documents found in inbox. 2023-12-17 09:40:26.611 INFO --- [ InboxCubit] - refreshItemsInInboxCount : Checking for new documents in inbox... 2023-12-17 09:40:26.668 INFO --- [ InboxCubit] - refreshItemsInInboxCount : No new documents found in inbox. 2023-12-17 10:25:02.603 INFO --- [ InboxCubit] - refreshItemsInInboxCount : Checking for new documents in inbox... 2023-12-17 10:25:02.673 INFO --- [ InboxCubit] - refreshItemsInInboxCount : No new documents found in inbox. 2023-12-17 10:25:32.616 INFO --- [ InboxCubit] - refreshItemsInInboxCount : Checking for new documents in inbox... 2023-12-17 10:25:32.705 INFO --- [ InboxCubit] - refreshItemsInInboxCount : No new documents found in inbox. 2023-12-17 10:40:25.923 INFO --- [ InboxCubit] - refreshItemsInInboxCount : Checking for new documents in inbox... 2023-12-17 10:40:26.013 INFO --- [ InboxCubit] - refreshItemsInInboxCount : No new documents found in inbox. 2023-12-17 10:40:55.923 INFO --- [ InboxCubit] - refreshItemsInInboxCount : Checking for new documents in inbox... 2023-12-17 10:40:55.965 INFO --- [ InboxCubit] - refreshItemsInInboxCount : No new documents found in inbox. 2023-12-17 10:41:25.922 INFO --- [ InboxCubit] - refreshItemsInInboxCount : Checking for new documents in inbox... 2023-12-17 10:41:26.036 INFO --- [ InboxCubit] - refreshItemsInInboxCount : No new documents found in inbox. 2023-12-17 10:50:49.286 DEBUG --- [ AuthenticationCubit] - restoreSession : Trying to restore previous session... 2023-12-17 10:50:49.287 DEBUG --- [ AuthenticationCubit] - restoreSession : Reading encrypted credentials... 2023-12-17 10:50:49.291 INFO --- [ ] - : Setting refresh rate to 90.0 2023-12-17 10:50:49.471 DEBUG --- [ AuthenticationCubit] - restoreSession : Credentials successfully retrieved. 2023-12-17 10:50:49.471 DEBUG --- [ AuthenticationCubit] - restoreSession : Updating security context... 2023-12-17 10:50:49.471 DEBUG --- [ AuthenticationCubit] - restoreSession : Security context successfully updated. 2023-12-17 10:50:49.593 DEBUG --- [ AuthenticationCubit] - restoreSession : Trying to update remote paperless user... 2023-12-17 10:50:49.593 DEBUG --- [ AuthenticationCubit] - _getApiVersion : Trying to fetch API version... 2023-12-17 10:50:49.640 DEBUG --- [ AuthenticationCubit] - _getApiVersion : Successfully retrieved API version (3). 2023-12-17 10:50:49.641 DEBUG --- [ AuthenticationCubit] - _updateRemoteUser : Trying to update remote user object... 2023-12-17 10:50:49.680 DEBUG --- [ AuthenticationCubit] - _updateRemoteUser : Successfully updated remote user object. 2023-12-17 10:50:49.680 DEBUG --- [ AuthenticationCubit] - restoreSession : Successfully updated remote paperless user. 2023-12-17 10:50:49.680 DEBUG --- [ AuthenticationCubit] - restoreSession : Previous session successfully restored. 2023-12-17 10:50:49.686 DEBUG --- [ LabelRepository] - findAllTags : Loading all tags... 2023-12-17 10:50:49.687 INFO --- [ InboxCubit] - refreshItemsInInboxCount : Checking for new documents in inbox... 2023-12-17 10:50:49.707 DEBUG --- [ LabelRepository] - findAllTags : Loading all tags... 2023-12-17 10:50:49.708 INFO --- [ InboxCubit] - refreshItemsInInboxCount : Checking for new documents in inbox... 2023-12-17 10:50:49.951 DEBUG --- [ LabelRepository] - findAllTags : Successfully updated all tags. 2023-12-17 10:50:50.069 INFO --- [ InboxCubit] - refreshItemsInInboxCount : No new documents found in inbox. 2023-12-17 10:50:50.070 DEBUG --- [ LabelRepository] - findAllTags : Loading all tags... 2023-12-17 10:50:50.142 DEBUG --- [ LabelRepository] - findAllTags : Successfully updated all tags. 2023-12-17 10:50:50.263 INFO --- [ InboxCubit] - refreshItemsInInboxCount : No new documents found in inbox. 2023-12-17 10:50:50.263 DEBUG --- [ LabelRepository] - findAllTags : Loading all tags... 2023-12-17 10:50:50.280 DEBUG --- [ LabelRepository] - findAllTags : Successfully updated all tags. 2023-12-17 10:50:50.373 DEBUG --- [ LabelRepository] - findAllTags : Successfully updated all tags. 2023-12-17 10:50:59.417 INFO --- [ DocumentEditCubit] - loadFieldSuggestions : Loading suggestions for document 61... 2023-12-17 10:50:59.691 INFO --- [ DocumentEditCubit] - loadFieldSuggestions : Found 3 suggestions for document 61. 2023-12-17 10:51:01.445 INFO --- [ DocumentEditCubit] - updateDocument : Updating document 61... 2023-12-17 10:51:03.405 INFO --- [ DocumentEditCubit] - updateDocument : Updating document 61... 2023-12-17 10:51:04.120 INFO --- [ DocumentEditCubit] - updateDocument : Updating document 61... 2023-12-17 10:51:19.715 INFO --- [ InboxCubit] - refreshItemsInInboxCount : Checking for new documents in inbox... 2023-12-17 10:51:19.795 INFO --- [ InboxCubit] - refreshItemsInInboxCount : No new documents found in inbox.

rajalreadytaken commented 10 months ago

logcat (edited tag names with personal info to TAG01, TAG02, etc)

lagset commented 10 months ago

The following appears in my app log when

  1. editing a document (add tags)
  2. Then saving (which does not close the details)
  3. then exiting and confirming to discard the change (while the changes are not really discarded)

Then doing the same 3 steps again (but this time removing the added tag from the document).

System Google Pixel 8 Android 14 Paperless-mobile 3.1.5+59 Paperless 2.1.1

Logs (paperless-mobile)

2023-12-17 17:50:15.614 DEBUG   --- [          LabelRepository] - findAllTags              : Loading all tags...
2023-12-17 17:50:16.039 DEBUG   --- [          LabelRepository] - findAllTags              : Successfully updated all tags.
2023-12-17 17:50:45.620 INFO    --- [               InboxCubit] - refreshItemsInInboxCount : Checking for new documents in inbox...
2023-12-17 17:50:45.889 INFO    --- [               InboxCubit] - refreshItemsInInboxCount : No new documents found in inbox.
2023-12-17 17:50:59.361 INFO    --- [        DocumentEditCubit] - loadFieldSuggestions     : Loading suggestions for document 957...
2023-12-17 17:50:59.619 INFO    --- [        DocumentEditCubit] - loadFieldSuggestions     : Found 3 suggestions for document 957.
2023-12-17 17:51:06.081 INFO    --- [        DocumentEditCubit] - updateDocument           : Updating document 957...
2023-12-17 17:51:09.415 INFO    --- [        DocumentEditCubit] - loadFieldSuggestions     : Loading suggestions for document 957...
2023-12-17 17:51:09.861 INFO    --- [        DocumentEditCubit] - loadFieldSuggestions     : Found 3 suggestions for document 957.
2023-12-17 17:51:12.636 DEBUG   --- [          LabelRepository] - findAllTags              : Loading all tags...
2023-12-17 17:51:13.017 DEBUG   --- [          LabelRepository] - findAllTags              : Successfully updated all tags.
2023-12-17 17:51:15.622 INFO    --- [               InboxCubit] - refreshItemsInInboxCount : Checking for new documents in inbox...
2023-12-17 17:51:15.802 INFO    --- [               InboxCubit] - refreshItemsInInboxCount : No new documents found in inbox.
2023-12-17 17:51:16.260 INFO    --- [        DocumentEditCubit] - loadFieldSuggestions     : Loading suggestions for document 957...
2023-12-17 17:51:16.522 INFO    --- [        DocumentEditCubit] - loadFieldSuggestions     : Found 3 suggestions for document 957.
2023-12-17 17:51:18.209 INFO    --- [        DocumentEditCubit] - updateDocument           : Updating document 957...
2023-12-17 17:51:52.995 INFO    --- [               InboxCubit] - refreshItemsInInboxCount : Checking for new documents in inbox...
2023-12-17 17:51:53.279 INFO    --- [               InboxCubit] - refreshItemsInInboxCount : No new documents found in inbox.
2023-12-17 17:52:22.991 INFO    --- [               InboxCubit] - refreshItemsInInboxCount : Checking for new documents in inbox...
2023-12-17 17:52:23.386 INFO    --- [               InboxCubit] - refreshItemsInInboxCount : No new documents found in inbox.
astubenbord commented 10 months ago

Okay, thanks guys. From what I can see the update call to /api/documents/:id/ does not return since there is a missing log which would be printed after "Updating document :id".

But no idea why this happens, if there was an error it should be shown in the logs. I'll do some testing and report back.

astubenbord commented 10 months ago

Could you try to restart your paperless instance to rule out the possibility that there is an issue with the server?

bjornbostrom commented 10 months ago

Hi, Promised to get back with logs, but I will not fill this thread with yet more logdata, my logs pretty much shows the same, just a single line with "DocumentEditCubit] - updateDocument : Updating document 13..." with no log printed after it.

My setup is a NGINX frontend shielding the dockerinstance by proxying the requests. Tried to restart all services with no further success... Eveyrhing works fine with the normal browser GUI.

rajalreadytaken commented 10 months ago

Could you try to restart your paperless instance to rule out the possibility that there is an issue with the server?

Restarted the containers and still the exact same result. Logs show the same activity

lagset commented 10 months ago

Restarted paperless server as well. Issue still exists.

If relevant: I am using a reverse proxy setup as well. Currently using the Synology DSM 7.2 "Login Portal" which offers basic reverse proxy functionality. As far as I know, internally Login Portal is a nginx web server.

astubenbord commented 10 months ago

Thanks. I guess there's not much more I can do at the moment except increasing the degree of detail shown in the logs. I'll upload a pre-release with much more detailed log output so I can see where exactly what goes wrong.

astubenbord commented 10 months ago

Okay, so just a quick update: I couldn't reproduce the issue with my production instance (Paperless-ngx v2.1.3) which is running only in my local network. Then I tried with a test instance I use as a demo instance for Google Play for instance (also Paperless-ngx v2.1.3), which has the exact same configuration (just with fewer and different data). Here I actually could reproduce the issue, which occurs due to an uncaught error when receiving a HTTP 500 response from the server, which is weird. Unfortunately, the server logs don't show any related information. I'll try to find a pattern or whether some information is missing in these requests. I'll keep you updated as I go.

astubenbord commented 10 months ago

Okay, so I found the issue and already implemented a fix. Seems like the error was thrown because I sent null permissions instead of empty permissions (i.e. {groups: [], users: []}) which is done in the frontend. I'd argue that this a bug since there is no server-side validation in place to test this. I'll open an issue over on paperless-ngx and ask if this is intended or not (but judging from the 500 error it is not). I'll try to publish an update this evening.

EDIT: Actually it seems to be an issue with the new custom_fields, not permissions. That's probably why this was not an issue before 2.1.x.

Maybe some of you can try to confirm that the following error pops up in the docker container log of the webserver (the error did not show in the log of the web client):

[2023-12-19 21:41:05,097] [ERROR] [django.request] Internal Server Error: /api/documents/2/
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/asgiref/sync.py", line 534, in thread_handler
    raise exc_info[1]
  File "/usr/local/lib/python3.11/site-packages/django/core/handlers/exception.py", line 42, in inner
    response = await get_response(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/asgiref/sync.py", line 534, in thread_handler
    raise exc_info[1]
  File "/usr/local/lib/python3.11/site-packages/django/core/handlers/base.py", line 253, in _get_response_async
    response = await wrapped_callback(
               ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/asgiref/sync.py", line 479, in __call__
    ret: _R = await loop.run_in_executor(
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/asgiref/current_thread_executor.py", line 40, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/asgiref/sync.py", line 538, in thread_handler
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/django/views/decorators/csrf.py", line 56, in wrapper_view
    return view_func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/rest_framework/viewsets.py", line 125, in view
    return self.dispatch(request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/rest_framework/views.py", line 509, in dispatch
    response = self.handle_exception(exc)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/rest_framework/views.py", line 469, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/usr/local/lib/python3.11/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
    raise exc
  File "/usr/local/lib/python3.11/site-packages/rest_framework/views.py", line 506, in dispatch
    response = handler(request, *args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/paperless/src/documents/views.py", line 319, in update
    response = super().update(request, *args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/rest_framework/mixins.py", line 68, in update
    self.perform_update(serializer)
  File "/usr/local/lib/python3.11/site-packages/rest_framework/mixins.py", line 78, in perform_update
    serializer.save()
  File "/usr/local/lib/python3.11/site-packages/drf_writable_nested/mixins.py", line 233, in save
    return super(BaseNestedModelSerializer, self).save(**kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/rest_framework/serializers.py", line 207, in save
    self.instance = self.update(self.instance, validated_data)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/paperless/src/documents/serialisers.py", line 530, in update
    super().update(instance, validated_data)
  File "/usr/src/paperless/src/documents/serialisers.py", line 245, in update
    return super().update(instance, validated_data)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/drf_writable_nested/mixins.py", line 291, in update
    self.delete_reverse_relations_if_need(instance, reverse_relations)
  File "/usr/local/lib/python3.11/site-packages/drf_writable_nested/mixins.py", line 342, in delete_reverse_relations_if_need
    current_ids = self._extract_related_pks(field, related_data)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/drf_writable_nested/mixins.py", line 118, in _extract_related_pks
    for d in filter(None, related_data):
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not iterable
bjornbostrom commented 10 months ago

Great to hear that you found the bug. Much appreciated :)

Checked my container logs and indeed - the same error were thrown there...

[2023-12-19 22:11:13,746] [ERROR] [django.request] Internal Server Error: /api/documents/103/ Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/asgiref/sync.py", line 534, in thread_handler raise exc_info[1] File "/usr/local/lib/python3.11/site-packages/django/core/handlers/exception.py", line 42, in inner response = await get_response(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/asgiref/sync.py", line 534, in thread_handler raise exc_info[1] File "/usr/local/lib/python3.11/site-packages/django/core/handlers/base.py", line 253, in _get_response_async response = await wrapped_callback( ^^^^^^^^^^^^^^^^^^^^^^^ [CLIP]