Glagan / SyncDex

Automatically sync what you read on MangaDex across many services like MyAnimeList, Anilist, Kitsu and more.
Mozilla Public License 2.0
46 stars 0 forks source link

[BUG] Logs not properly saving (possibly only online storage) #6

Closed cpiber closed 3 years ago

cpiber commented 3 years ago

Describe the bug Log entries related to Sync Dex disappear.

To Reproduce Steps to reproduce the behavior:

  1. Log into Google Drive
  2. Click import

Browser Firefox 84.0

Options and logs before

{"lastSync":1608972922243,"logs":[{"d":1608744434310,"msg":"Installation version 0.1"},{"d":1608750549612,"msg":"Uploaded Local Save to Google Drive"},{"d":1608750549624,"msg":"Synced your save with GoogleDrive"},{"d":1608750662383,"msg":"Error: Could not establish connection. Receiving end does not exist.\nStack: syncSave@moz-extension://33477aff-cb89-4241-a0c9-349e02f7edb0/background/SyncDex_background.js:5473:47\n"},{"d":1608751087846,"msg":"Error: Could not establish connection. Receiving end does not exist.\nStack: syncSave@moz-extension://33477aff-cb89-4241-a0c9-349e02f7edb0/background/SyncDex_background.js:5473:47\n"},{"d":1608751497412,"msg":"Error: Could not establish connection. Receiving end does not exist.\nStack: syncSave@moz-extension://33477aff-cb89-4241-a0c9-349e02f7edb0/background/SyncDex_background.js:5473:47\n"},{"d":1608751645848,"msg":"Uploaded Local Save to Google Drive"},{"d":1608751645853,"msg":"Synced your save with GoogleDrive"},{"d":1608753068663,"msg":"Uploaded Local Save to Google Drive"},{"d":1608753068667,"msg":"Synced your save with GoogleDrive"},{"d":1608753130249,"msg":"Uploaded Local Save to Google Drive"},{"d":1608753130254,"msg":"Synced your save with GoogleDrive"},{"d":1608753431527,"msg":"Error: Could not establish connection. Receiving end does not exist.\nStack: syncSave@moz-extension://33477aff-cb89-4241-a0c9-349e02f7edb0/background/SyncDex_background.js:5473:47\n"},{"d":1608753502835,"msg":"Error: Could not establish connection. Receiving end does not exist.\nStack: syncSave@moz-extension://33477aff-cb89-4241-a0c9-349e02f7edb0/background/SyncDex_background.js:5473:47\n"},{"d":1608753749669,"msg":"Error: Could not establish connection. Receiving end does not exist.\nStack: syncSave@moz-extension://33477aff-cb89-4241-a0c9-349e02f7edb0/background/SyncDex_background.js:5473:47\n"},{"d":1608753911226,"msg":"Error: Could not establish connection. Receiving end does not exist.\nStack: syncSave@moz-extension://33477aff-cb89-4241-a0c9-349e02f7edb0/background/SyncDex_background.js:5473:47\n"},{"d":1608754255875,"msg":"Error: Could not establish connection. Receiving end does not exist.\nStack: syncSave@moz-extension://33477aff-cb89-4241-a0c9-349e02f7edb0/background/SyncDex_background.js:5473:47\n"},{"d":1608754444835,"msg":"Error: Could not establish connection. Receiving end does not exist.\nStack: syncSave@moz-extension://33477aff-cb89-4241-a0c9-349e02f7edb0/background/SyncDex_background.js:5473:47\n"},{"d":1608754730113,"msg":"Error: Could not establish connection. Receiving end does not exist.\nStack: syncSave@moz-extension://33477aff-cb89-4241-a0c9-349e02f7edb0/background/SyncDex_background.js:5473:47\n"},{"d":1608756826385,"msg":"Error: Could not establish connection. Receiving end does not exist.\nStack: syncSave@moz-extension://33477aff-cb89-4241-a0c9-349e02f7edb0/background/SyncDex_background.js:5473:47\n"},{"d":1608757083908,"msg":"Uploaded Local Save to Google Drive"},{"d":1608757083917,"msg":"Synced your save with GoogleDrive"},{"d":1608757158043,"msg":"Uploaded Local Save to Google Drive"},{"d":1608757158048,"msg":"Synced your save with GoogleDrive"},{"d":1608757342920,"msg":"Error: Could not establish connection. Receiving end does not exist.\nStack: syncSave@moz-extension://33477aff-cb89-4241-a0c9-349e02f7edb0/background/SyncDex_background.js:5473:47\n"},{"d":1608758228477,"msg":"Updating from version 0.1.1 to 0.1.2"},{"d":1608758295002,"msg":"Uploaded Local Save to Google Drive"},{"d":1608758295009,"msg":"Synced your save with GoogleDrive"},{"d":1608759113094,"msg":"Uploaded Local Save to Google Drive"},{"d":1608759113096,"msg":"Synced your save with GoogleDrive"},{"d":1608759356018,"msg":"Uploaded Local Save to Google Drive"},{"d":1608759356022,"msg":"Synced your save with GoogleDrive"},{"d":1608929470495,"msg":"Error: Could not establish connection. Receiving end does not exist.\nStack: syncSave@moz-extension://209dabdc-0f8d-449c-aa72-5270bc99c3d8/background/SyncDex_background.js:5518:47\n"},{"d":1608972316530,"msg":"Error: Could not establish connection. Receiving end does not exist.\nStack: syncSave@moz-extension://209dabdc-0f8d-449c-aa72-5270bc99c3d8/background/SyncDex_background.js:5518:47\n"},{"d":1608972373516,"msg":"Refreshing Google Drive token (expired 1608890066543)"},{"d":1608972379963,"msg":"Refreshing Google Drive token (expired 1608890066543)"},{"d":1608972674810,"msg":"Refreshing Google Drive token (expired 1608890066543)"}],"options":{"hideHigher":false,"hideLower":false,"hideLast":false,"highlight":true,"groupTitlesInLists":false,"thumbnail":true,"originalThumbnail":false,"progressInThumbnail":true,"thumbnailMaxHeight":80,"separateLanguages":true,"favoriteLanguage":"gb","saveOpenedChapters":false,"chaptersSaved":100,"saveOnlyHigher":true,"saveOnlyNext":true,"confirmChapter":true,"updateOnlyInList":true,"linkToServices":true,"overviewMainOnly":true,"autoSync":true,"mdUpdateSyncDex":false,"biggerHistory":false,"chapterStatus":false,"notifications":true,"errorNotifications":true,"useMochi":true,"acceptLowScore":false,"updateMD":true,"checkOnStartup":false,"checkOnStartupMainOnly":true,"checkOnStartupCooldown":30,"services":["mu","mal","ku"],"mainService":"mu","noReloadStatus":true,"tokens":{},"colors":{"highlights":["rgba(28, 135, 141, 0.8)","rgba(22, 65, 87, 0.8)","rgba(28, 103, 141, 0.8)"],"nextChapter":"rgba(199, 146, 2, 0.4)","higherChapter":"transparent","lowerChapter":"rgba(180, 102, 75, 0.4)","openedChapter":"rgba(28, 135, 141, 0.4)"},"version":0.1,"subVersion":2},"saveSync":{"service":"GoogleDrive","token":"set","expires":1608976518051,"refresh":"set","id":"1V-xe6upxt54uicgts4wU3zU9uXTbeWge6DkLAsTE07KLLrxgEA"}}

Options and logs after login

{"lastSync":1608973402267,"logs":[{"d":1608744434310,"msg":"Installation version 0.1"},{"d":1608750549612,"msg":"Uploaded Local Save to Google Drive"},{"d":1608750549624,"msg":"Synced your save with GoogleDrive"},{"d":1608750662383,"msg":"Error: Could not establish connection. Receiving end does not exist.\nStack: syncSave@moz-extension://33477aff-cb89-4241-a0c9-349e02f7edb0/background/SyncDex_background.js:5473:47\n"},{"d":1608751087846,"msg":"Error: Could not establish connection. Receiving end does not exist.\nStack: syncSave@moz-extension://33477aff-cb89-4241-a0c9-349e02f7edb0/background/SyncDex_background.js:5473:47\n"},{"d":1608751497412,"msg":"Error: Could not establish connection. Receiving end does not exist.\nStack: syncSave@moz-extension://33477aff-cb89-4241-a0c9-349e02f7edb0/background/SyncDex_background.js:5473:47\n"},{"d":1608751645848,"msg":"Uploaded Local Save to Google Drive"},{"d":1608751645853,"msg":"Synced your save with GoogleDrive"},{"d":1608753068663,"msg":"Uploaded Local Save to Google Drive"},{"d":1608753068667,"msg":"Synced your save with GoogleDrive"},{"d":1608753130249,"msg":"Uploaded Local Save to Google Drive"},{"d":1608753130254,"msg":"Synced your save with GoogleDrive"},{"d":1608753431527,"msg":"Error: Could not establish connection. Receiving end does not exist.\nStack: syncSave@moz-extension://33477aff-cb89-4241-a0c9-349e02f7edb0/background/SyncDex_background.js:5473:47\n"},{"d":1608753502835,"msg":"Error: Could not establish connection. Receiving end does not exist.\nStack: syncSave@moz-extension://33477aff-cb89-4241-a0c9-349e02f7edb0/background/SyncDex_background.js:5473:47\n"},{"d":1608753749669,"msg":"Error: Could not establish connection. Receiving end does not exist.\nStack: syncSave@moz-extension://33477aff-cb89-4241-a0c9-349e02f7edb0/background/SyncDex_background.js:5473:47\n"},{"d":1608753911226,"msg":"Error: Could not establish connection. Receiving end does not exist.\nStack: syncSave@moz-extension://33477aff-cb89-4241-a0c9-349e02f7edb0/background/SyncDex_background.js:5473:47\n"},{"d":1608754255875,"msg":"Error: Could not establish connection. Receiving end does not exist.\nStack: syncSave@moz-extension://33477aff-cb89-4241-a0c9-349e02f7edb0/background/SyncDex_background.js:5473:47\n"},{"d":1608754444835,"msg":"Error: Could not establish connection. Receiving end does not exist.\nStack: syncSave@moz-extension://33477aff-cb89-4241-a0c9-349e02f7edb0/background/SyncDex_background.js:5473:47\n"},{"d":1608754730113,"msg":"Error: Could not establish connection. Receiving end does not exist.\nStack: syncSave@moz-extension://33477aff-cb89-4241-a0c9-349e02f7edb0/background/SyncDex_background.js:5473:47\n"},{"d":1608756826385,"msg":"Error: Could not establish connection. Receiving end does not exist.\nStack: syncSave@moz-extension://33477aff-cb89-4241-a0c9-349e02f7edb0/background/SyncDex_background.js:5473:47\n"},{"d":1608757083908,"msg":"Uploaded Local Save to Google Drive"},{"d":1608757083917,"msg":"Synced your save with GoogleDrive"},{"d":1608757158043,"msg":"Uploaded Local Save to Google Drive"},{"d":1608757158048,"msg":"Synced your save with GoogleDrive"},{"d":1608757342920,"msg":"Error: Could not establish connection. Receiving end does not exist.\nStack: syncSave@moz-extension://33477aff-cb89-4241-a0c9-349e02f7edb0/background/SyncDex_background.js:5473:47\n"},{"d":1608758228477,"msg":"Updating from version 0.1.1 to 0.1.2"},{"d":1608758295002,"msg":"Uploaded Local Save to Google Drive"},{"d":1608758295009,"msg":"Synced your save with GoogleDrive"},{"d":1608759113094,"msg":"Uploaded Local Save to Google Drive"},{"d":1608759113096,"msg":"Synced your save with GoogleDrive"},{"d":1608759356018,"msg":"Uploaded Local Save to Google Drive"},{"d":1608759356022,"msg":"Synced your save with GoogleDrive"},{"d":1608929470495,"msg":"Error: Could not establish connection. Receiving end does not exist.\nStack: syncSave@moz-extension://209dabdc-0f8d-449c-aa72-5270bc99c3d8/background/SyncDex_background.js:5518:47\n"},{"d":1608972316530,"msg":"Error: Could not establish connection. Receiving end does not exist.\nStack: syncSave@moz-extension://209dabdc-0f8d-449c-aa72-5270bc99c3d8/background/SyncDex_background.js:5518:47\n"},{"d":1608972373516,"msg":"Refreshing Google Drive token (expired 1608890066543)"},{"d":1608972379963,"msg":"Refreshing Google Drive token (expired 1608890066543)"},{"d":1608972674810,"msg":"Refreshing Google Drive token (expired 1608890066543)"},{"d":1608972824242,"msg":"Updating from version 0.1.2 to 0.1.4"},{"d":1608972923606,"msg":"Uploaded Local Save to Google Drive"},{"d":1608972923620,"msg":"Synced your save with GoogleDrive"},{"d":1608973403692,"msg":"Uploaded Local Save to Google Drive"},{"d":1608973403740,"msg":"Synced your save with GoogleDrive"}],"options":{"hideHigher":false,"hideLower":false,"hideLast":false,"highlight":true,"groupTitlesInLists":false,"thumbnail":true,"originalThumbnail":false,"progressInThumbnail":true,"thumbnailMaxHeight":80,"separateLanguages":true,"favoriteLanguage":"gb","saveOpenedChapters":false,"chaptersSaved":100,"saveOnlyHigher":true,"saveOnlyNext":true,"confirmChapter":true,"updateOnlyInList":true,"linkToServices":true,"overviewMainOnly":true,"autoSync":true,"mdUpdateSyncDex":false,"biggerHistory":false,"chapterStatus":false,"notifications":true,"errorNotifications":true,"useMochi":true,"acceptLowScore":false,"updateMD":true,"checkOnStartup":false,"checkOnStartupMainOnly":true,"checkOnStartupCooldown":30,"services":["mu","mal","ku"],"mainService":"mu","noReloadStatus":true,"tokens":{},"colors":{"highlights":["rgba(28, 135, 141, 0.8)","rgba(22, 65, 87, 0.8)","rgba(28, 103, 141, 0.8)"],"nextChapter":"rgba(199, 146, 2, 0.4)","higherChapter":"transparent","lowerChapter":"rgba(180, 102, 75, 0.4)","openedChapter":"rgba(28, 135, 141, 0.4)"},"version":0.1,"subVersion":2},"saveSync":{"service":"GoogleDrive","token":"set","expires":1608976997776,"refresh":"set","id":"1V-xe6upxt54uicgts4wU3zU9uXTbeWge6DkLAsTE07KLLrxgEA"}}

Options and logs after import

{"lastSync":1608973402267,"logs":[{"d":1608744434310,"msg":"Installation version 0.1"},{"d":1608750549612,"msg":"Uploaded Local Save to Google Drive"},{"d":1608750549624,"msg":"Synced your save with GoogleDrive"},{"d":1608750662383,"msg":"Error: Could not establish connection. Receiving end does not exist.\nStack: syncSave@moz-extension://33477aff-cb89-4241-a0c9-349e02f7edb0/background/SyncDex_background.js:5473:47\n"},{"d":1608751087846,"msg":"Error: Could not establish connection. Receiving end does not exist.\nStack: syncSave@moz-extension://33477aff-cb89-4241-a0c9-349e02f7edb0/background/SyncDex_background.js:5473:47\n"},{"d":1608751497412,"msg":"Error: Could not establish connection. Receiving end does not exist.\nStack: syncSave@moz-extension://33477aff-cb89-4241-a0c9-349e02f7edb0/background/SyncDex_background.js:5473:47\n"},{"d":1608751645848,"msg":"Uploaded Local Save to Google Drive"},{"d":1608751645853,"msg":"Synced your save with GoogleDrive"},{"d":1608753068663,"msg":"Uploaded Local Save to Google Drive"},{"d":1608753068667,"msg":"Synced your save with GoogleDrive"},{"d":1608753130249,"msg":"Uploaded Local Save to Google Drive"},{"d":1608753130254,"msg":"Synced your save with GoogleDrive"},{"d":1608753431527,"msg":"Error: Could not establish connection. Receiving end does not exist.\nStack: syncSave@moz-extension://33477aff-cb89-4241-a0c9-349e02f7edb0/background/SyncDex_background.js:5473:47\n"},{"d":1608753502835,"msg":"Error: Could not establish connection. Receiving end does not exist.\nStack: syncSave@moz-extension://33477aff-cb89-4241-a0c9-349e02f7edb0/background/SyncDex_background.js:5473:47\n"},{"d":1608753749669,"msg":"Error: Could not establish connection. Receiving end does not exist.\nStack: syncSave@moz-extension://33477aff-cb89-4241-a0c9-349e02f7edb0/background/SyncDex_background.js:5473:47\n"},{"d":1608753911226,"msg":"Error: Could not establish connection. Receiving end does not exist.\nStack: syncSave@moz-extension://33477aff-cb89-4241-a0c9-349e02f7edb0/background/SyncDex_background.js:5473:47\n"},{"d":1608754255875,"msg":"Error: Could not establish connection. Receiving end does not exist.\nStack: syncSave@moz-extension://33477aff-cb89-4241-a0c9-349e02f7edb0/background/SyncDex_background.js:5473:47\n"},{"d":1608754444835,"msg":"Error: Could not establish connection. Receiving end does not exist.\nStack: syncSave@moz-extension://33477aff-cb89-4241-a0c9-349e02f7edb0/background/SyncDex_background.js:5473:47\n"},{"d":1608754730113,"msg":"Error: Could not establish connection. Receiving end does not exist.\nStack: syncSave@moz-extension://33477aff-cb89-4241-a0c9-349e02f7edb0/background/SyncDex_background.js:5473:47\n"},{"d":1608756826385,"msg":"Error: Could not establish connection. Receiving end does not exist.\nStack: syncSave@moz-extension://33477aff-cb89-4241-a0c9-349e02f7edb0/background/SyncDex_background.js:5473:47\n"},{"d":1608757083908,"msg":"Uploaded Local Save to Google Drive"},{"d":1608757083917,"msg":"Synced your save with GoogleDrive"},{"d":1608757158043,"msg":"Uploaded Local Save to Google Drive"},{"d":1608757158048,"msg":"Synced your save with GoogleDrive"},{"d":1608757342920,"msg":"Error: Could not establish connection. Receiving end does not exist.\nStack: syncSave@moz-extension://33477aff-cb89-4241-a0c9-349e02f7edb0/background/SyncDex_background.js:5473:47\n"},{"d":1608758228477,"msg":"Updating from version 0.1.1 to 0.1.2"},{"d":1608758295002,"msg":"Uploaded Local Save to Google Drive"},{"d":1608758295009,"msg":"Synced your save with GoogleDrive"},{"d":1608759113094,"msg":"Uploaded Local Save to Google Drive"},{"d":1608759113096,"msg":"Synced your save with GoogleDrive"},{"d":1608759356018,"msg":"Uploaded Local Save to Google Drive"},{"d":1608759356022,"msg":"Synced your save with GoogleDrive"},{"d":1608929470495,"msg":"Error: Could not establish connection. Receiving end does not exist.\nStack: syncSave@moz-extension://209dabdc-0f8d-449c-aa72-5270bc99c3d8/background/SyncDex_background.js:5518:47\n"},{"d":1608972316530,"msg":"Error: Could not establish connection. Receiving end does not exist.\nStack: syncSave@moz-extension://209dabdc-0f8d-449c-aa72-5270bc99c3d8/background/SyncDex_background.js:5518:47\n"},{"d":1608972373516,"msg":"Refreshing Google Drive token (expired 1608890066543)"},{"d":1608972379963,"msg":"Refreshing Google Drive token (expired 1608890066543)"},{"d":1608972674810,"msg":"Refreshing Google Drive token (expired 1608890066543)"}],"options":{"hideHigher":false,"hideLower":false,"hideLast":false,"highlight":true,"groupTitlesInLists":false,"thumbnail":true,"originalThumbnail":false,"progressInThumbnail":true,"thumbnailMaxHeight":80,"separateLanguages":true,"favoriteLanguage":"gb","saveOpenedChapters":false,"chaptersSaved":100,"saveOnlyHigher":true,"saveOnlyNext":true,"confirmChapter":true,"updateOnlyInList":true,"linkToServices":true,"overviewMainOnly":true,"autoSync":true,"mdUpdateSyncDex":false,"biggerHistory":false,"chapterStatus":false,"notifications":true,"errorNotifications":true,"useMochi":true,"acceptLowScore":false,"updateMD":true,"checkOnStartup":false,"checkOnStartupMainOnly":true,"checkOnStartupCooldown":30,"services":["mu","mal","ku"],"mainService":"mu","noReloadStatus":true,"tokens":{},"colors":{"highlights":["rgba(28, 135, 141, 0.8)","rgba(22, 65, 87, 0.8)","rgba(28, 103, 141, 0.8)"],"nextChapter":"rgba(199, 146, 2, 0.4)","higherChapter":"transparent","lowerChapter":"rgba(180, 102, 75, 0.4)","openedChapter":"rgba(28, 135, 141, 0.4)"},"version":0.1,"subVersion":2},"saveSync":{"service":"GoogleDrive","token":"set","expires":1608976997776,"refresh":"set","id":"1V-xe6upxt54uicgts4wU3zU9uXTbeWge6DkLAsTE07KLLrxgEA"}}
Glagan commented 3 years ago

Logs are not saved in Google Drive, this was to make it simple and avoid logs triggering a save.
But logs should stay between imports, as long as they don't get removed or reset it's working as intended.

cpiber commented 3 years ago

No, that's exactly it, If I import the last four messages disappear

Glagan commented 3 years ago

I was actually not deleting the logs and they were being saved, but also logs are kept in memory if the options page is not unloaded, and it should have saved them and deleted the new messages.

Glagan commented 3 years ago

Should be fixed along with other Save Sync bugs in 0.1.5.