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] Consistently getting logged out of Anilist and Kitsu services #42

Closed Jerrk closed 3 years ago

Jerrk commented 3 years ago

Describe the bug Whenever i open my browser to read some manga i notice an error popup in the lower left stating that kitsu and anilist is not tracking.

If i login to these services again they seem to work for that browser session.

if i then shut down the browser and reopen it i will have been logged out of both anilist and kitsu services. clicking refresh does nothing, i have to click login for both kitsu and anilist. what is stranger is that it appears the tracking info gathered from the previous session was not saved.

To Reproduce Steps to reproduce the behavior: Open browser login to anilist/kitsu services read some manga that update tracking restart the browser

you should now be logged out of kitsu and anilist, and the tracking should not have updated

Expected behavior (optional) i should not get logged out of anilist/kitsu

Browser Firefox 87.0a1 (2021-02-08) (64-bit)

Options and logs

{"import":1612852083914,"lastSync":1612852469000,"logs":[{"d":1612846609643,"msg":"No external lastSync or forced, uploading save."},{"d":1612846612767,"msg":"Synced your save with Dropbox"},{"d":1612846673104,"msg":"No external lastSync or forced, uploading save."},{"d":1612846675572,"msg":"Synced your save with Dropbox"},{"d":1612846735967,"msg":"No external lastSync or forced, uploading save."},{"d":1612846738768,"msg":"Synced your save with Dropbox"},{"d":1612846799160,"msg":"No external lastSync or forced, uploading save."},{"d":1612846801781,"msg":"Synced your save with Dropbox"},{"d":1612846862201,"msg":"No external lastSync or forced, uploading save."},{"d":1612846865479,"msg":"Synced your save with Dropbox"},{"d":1612846925794,"msg":"No external lastSync or forced, uploading save."},{"d":1612846928885,"msg":"Synced your save with Dropbox"},{"d":1612846989238,"msg":"No external lastSync or forced, uploading save."},{"d":1612846997939,"msg":"Synced your save with Dropbox"},{"d":1612847058255,"msg":"No external lastSync or forced, uploading save."},{"d":1612847060791,"msg":"Synced your save with Dropbox"},{"d":1612847121134,"msg":"No external lastSync or forced, uploading save."},{"d":1612847124729,"msg":"Synced your save with Dropbox"},{"d":1612847185374,"msg":"No external lastSync or forced, uploading save."},{"d":1612847187546,"msg":"Synced your save with Dropbox"},{"d":1612847247867,"msg":"No external lastSync or forced, uploading save."},{"d":1612847250428,"msg":"Synced your save with Dropbox"},{"d":1612847310742,"msg":"No external lastSync or forced, uploading save."},{"d":1612847314488,"msg":"Synced your save with Dropbox"},{"d":1612847374836,"msg":"No external lastSync or forced, uploading save."},{"d":1612847377416,"msg":"Synced your save with Dropbox"},{"d":1612847437738,"msg":"No external lastSync or forced, uploading save."},{"d":1612847442911,"msg":"Synced your save with Dropbox"},{"d":1612847503222,"msg":"No external lastSync or forced, uploading save."},{"d":1612847505901,"msg":"Synced your save with Dropbox"},{"d":1612847566264,"msg":"No external lastSync or forced, uploading save."},{"d":1612847569977,"msg":"Synced your save with Dropbox"},{"d":1612847630291,"msg":"No external lastSync or forced, uploading save."},{"d":1612847633022,"msg":"Synced your save with Dropbox"},{"d":1612847693472,"msg":"No external lastSync or forced, uploading save."},{"d":1612847696266,"msg":"Synced your save with Dropbox"},{"d":1612847756605,"msg":"No external lastSync or forced, uploading save."},{"d":1612847759252,"msg":"Synced your save with Dropbox"},{"d":1612847819566,"msg":"No external lastSync or forced, uploading save."},{"d":1612847822234,"msg":"Synced your save with Dropbox"},{"d":1612847882574,"msg":"No external lastSync or forced, uploading save."},{"d":1612847886099,"msg":"Synced your save with Dropbox"},{"d":1612847946473,"msg":"No external lastSync or forced, uploading save."},{"d":1612847949028,"msg":"Synced your save with Dropbox"},{"d":1612848009909,"msg":"No external lastSync or forced, uploading save."},{"d":1612848012437,"msg":"Synced your save with Dropbox"},{"d":1612848072930,"msg":"No external lastSync or forced, uploading save."},{"d":1612848075277,"msg":"Synced your save with Dropbox"},{"d":1612848135616,"msg":"No external lastSync or forced, uploading save."},{"d":1612848138012,"msg":"Synced your save with Dropbox"},{"d":1612848198304,"msg":"No external lastSync or forced, uploading save."},{"d":1612848201959,"msg":"Synced your save with Dropbox"},{"d":1612848262435,"msg":"No external lastSync or forced, uploading save."},{"d":1612848264978,"msg":"Synced your save with Dropbox"},{"d":1612848325311,"msg":"No external lastSync or forced, uploading save."},{"d":1612848328380,"msg":"Synced your save with Dropbox"},{"d":1612848388691,"msg":"No external lastSync or forced, uploading save."},{"d":1612848391100,"msg":"Synced your save with Dropbox"},{"d":1612848451460,"msg":"No external lastSync or forced, uploading save."},{"d":1612848454036,"msg":"Synced your save with Dropbox"},{"d":1612848514367,"msg":"No external lastSync or forced, uploading save."},{"d":1612848518320,"msg":"Synced your save with Dropbox"},{"d":1612848578702,"msg":"No external lastSync or forced, uploading save."},{"d":1612848581201,"msg":"Synced your save with Dropbox"},{"d":1612848641628,"msg":"No external lastSync or forced, uploading save."},{"d":1612848645415,"msg":"Synced your save with Dropbox"},{"d":1612848705775,"msg":"No external lastSync or forced, uploading save."},{"d":1612848709763,"msg":"Synced your save with Dropbox"},{"d":1612848770115,"msg":"No external lastSync or forced, uploading save."},{"d":1612848773655,"msg":"Synced your save with Dropbox"},{"d":1612848833998,"msg":"No external lastSync or forced, uploading save."},{"d":1612848837339,"msg":"Synced your save with Dropbox"},{"d":1612848897668,"msg":"No external lastSync or forced, uploading save."},{"d":1612848900538,"msg":"Synced your save with Dropbox"},{"d":1612848961421,"msg":"No external lastSync or forced, uploading save."},{"d":1612848964701,"msg":"Synced your save with Dropbox"},{"d":1612849025030,"msg":"No external lastSync or forced, uploading save."},{"d":1612849028791,"msg":"Synced your save with Dropbox"},{"d":1612849089124,"msg":"No external lastSync or forced, uploading save."},{"d":1612849093117,"msg":"Synced your save with Dropbox"},{"d":1612849153509,"msg":"No external lastSync or forced, uploading save."},{"d":1612849155933,"msg":"Synced your save with Dropbox"},{"d":1612849216253,"msg":"No external lastSync or forced, uploading save."},{"d":1612849219675,"msg":"Synced your save with Dropbox"},{"d":1612849279980,"msg":"No external lastSync or forced, uploading save."},{"d":1612849283836,"msg":"Synced your save with Dropbox"},{"d":1612849344222,"msg":"No external lastSync or forced, uploading save."},{"d":1612849346868,"msg":"Synced your save with Dropbox"},{"d":1612849407215,"msg":"No external lastSync or forced, uploading save."},{"d":1612849410187,"msg":"Synced your save with Dropbox"},{"d":1612849470523,"msg":"No external lastSync or forced, uploading save."},{"d":1612849474225,"msg":"Synced your save with Dropbox"},{"d":1612849534595,"msg":"No external lastSync or forced, uploading save."},{"d":1612849538163,"msg":"Synced your save with Dropbox"},{"d":1612849598621,"msg":"No external lastSync or forced, uploading save."},{"d":1612849601905,"msg":"Synced your save with Dropbox"},{"d":1612849662230,"msg":"No external lastSync or forced, uploading save."},{"d":1612849664899,"msg":"Synced your save with Dropbox"},{"d":1612849725201,"msg":"No external lastSync or forced, uploading save."},{"d":1612849727952,"msg":"Synced your save with Dropbox"},{"d":1612849788288,"msg":"No external lastSync or forced, uploading save."},{"d":1612849791274,"msg":"Synced your save with Dropbox"},{"d":1612850084911,"msg":"No local lastSync or 1612849788000 < 1612850032000, downloading save."},{"d":1612850089395,"msg":"Synced your save with Dropbox"},{"d":1612850089458,"msg":"Importing lists"},{"d":1612850089576,"msg":"Importing Anilist"},{"d":1612850089580,"msg":"Could not import Anilist | Status: 2"},{"d":1612850089630,"msg":"Done Importing lists"},{"d":1612850149995,"msg":"No external lastSync or forced, uploading save."},{"d":1612850153502,"msg":"Synced your save with Dropbox"},{"d":1612850213948,"msg":"No external lastSync or forced, uploading save."},{"d":1612850217349,"msg":"Synced your save with Dropbox"},{"d":1612850277818,"msg":"No external lastSync or forced, uploading save."},{"d":1612850281716,"msg":"Synced your save with Dropbox"},{"d":1612850342147,"msg":"No external lastSync or forced, uploading save."},{"d":1612850345941,"msg":"Synced your save with Dropbox"},{"d":1612850406246,"msg":"No external lastSync or forced, uploading save."},{"d":1612850409852,"msg":"Synced your save with Dropbox"},{"d":1612850470162,"msg":"No external lastSync or forced, uploading save."},{"d":1612850473553,"msg":"Synced your save with Dropbox"},{"d":1612850533835,"msg":"No external lastSync or forced, uploading save."},{"d":1612850537551,"msg":"Synced your save with Dropbox"},{"d":1612850597893,"msg":"No external lastSync or forced, uploading save."},{"d":1612850601633,"msg":"Synced your save with Dropbox"},{"d":1612850661962,"msg":"No external lastSync or forced, uploading save."},{"d":1612850665667,"msg":"Synced your save with Dropbox"},{"d":1612850725980,"msg":"No external lastSync or forced, uploading save."},{"d":1612850729636,"msg":"Synced your save with Dropbox"},{"d":1612850789965,"msg":"No external lastSync or forced, uploading save."},{"d":1612850793804,"msg":"Synced your save with Dropbox"},{"d":1612850854132,"msg":"No external lastSync or forced, uploading save."},{"d":1612850857670,"msg":"Synced your save with Dropbox"},{"d":1612850917953,"msg":"No external lastSync or forced, uploading save."},{"d":1612850921951,"msg":"Synced your save with Dropbox"},{"d":1612850982270,"msg":"No external lastSync or forced, uploading save."},{"d":1612850986106,"msg":"Synced your save with Dropbox"},{"d":1612851046474,"msg":"No external lastSync or forced, uploading save."},{"d":1612851050526,"msg":"Synced your save with Dropbox"},{"d":1612851110879,"msg":"No external lastSync or forced, uploading save."},{"d":1612851114319,"msg":"Synced your save with Dropbox"},{"d":1612851174612,"msg":"No external lastSync or forced, uploading save."},{"d":1612851178126,"msg":"Synced your save with Dropbox"},{"d":1612851238459,"msg":"No external lastSync or forced, uploading save."},{"d":1612851242011,"msg":"Synced your save with Dropbox"},{"d":1612851302323,"msg":"No external lastSync or forced, uploading save."},{"d":1612851307051,"msg":"Synced your save with Dropbox"},{"d":1612851367352,"msg":"No external lastSync or forced, uploading save."},{"d":1612851371067,"msg":"Synced your save with Dropbox"},{"d":1612851431445,"msg":"No external lastSync or forced, uploading save."},{"d":1612851434864,"msg":"Synced your save with Dropbox"},{"d":1612851486812,"msg":"No local lastSync or 1612851436000 < 1612851437000, downloading save."},{"d":1612851490469,"msg":"Synced your save with Dropbox"},{"d":1612851490620,"msg":"Importing lists"},{"d":1612851490624,"msg":"Importing Anilist"},{"d":1612851490628,"msg":"Could not import Anilist | Status: 2"},{"d":1612851490690,"msg":"Done Importing lists"},{"d":1612851551034,"msg":"No external lastSync or forced, uploading save."},{"d":1612851554706,"msg":"Synced your save with Dropbox"},{"d":1612851614976,"msg":"No external lastSync or forced, uploading save."},{"d":1612851618679,"msg":"Synced your save with Dropbox"},{"d":1612851675871,"msg":"No local lastSync or 1612851620000 < 1612851627000, downloading save."},{"d":1612851682686,"msg":"Synced your save with Dropbox"},{"d":1612851682731,"msg":"Importing lists"},{"d":1612851682741,"msg":"Importing Anilist"},{"d":1612851682746,"msg":"Could not import Anilist | Status: 2"},{"d":1612851682756,"msg":"Done Importing lists"},{"d":1612851743054,"msg":"No external lastSync or forced, uploading save."},{"d":1612851746590,"msg":"Synced your save with Dropbox"},{"d":1612851806883,"msg":"No external lastSync or forced, uploading save."},{"d":1612851810562,"msg":"Synced your save with Dropbox"},{"d":1612851870847,"msg":"No external lastSync or forced, uploading save."},{"d":1612851874624,"msg":"Synced your save with Dropbox"},{"d":1612851884199,"msg":"No local lastSync or 1612851876000 < 1612851883000, downloading save."},{"d":1612851888721,"msg":"Synced your save with Dropbox"},{"d":1612851888733,"msg":"Importing lists"},{"d":1612851888736,"msg":"Importing Anilist"},{"d":1612851888742,"msg":"Could not import Anilist | Status: 2"},{"d":1612851888776,"msg":"Done Importing lists"},{"d":1612851949052,"msg":"No external lastSync or forced, uploading save."},{"d":1612851951840,"msg":"Synced your save with Dropbox"},{"d":1612851961346,"msg":"Save already synced with Dropbox"},{"d":1612851961360,"msg":"Startup script executed less than 30minutes ago, skipping"},{"d":1612852079731,"msg":"No local lastSync or 1612851953000 < 1612852073000, downloading save."},{"d":1612852083822,"msg":"Synced your save with Dropbox"},{"d":1612852083887,"msg":"Importing lists"},{"d":1612852083891,"msg":"Importing Anilist"},{"d":1612852083898,"msg":"Could not import Anilist | Status: 2"},{"d":1612852083919,"msg":"Done Importing lists"},{"d":1612852144190,"msg":"No external lastSync or forced, uploading save."},{"d":1612852148082,"msg":"Synced your save with Dropbox"},{"d":1612852208363,"msg":"No external lastSync or forced, uploading save."},{"d":1612852211980,"msg":"Synced your save with Dropbox"},{"d":1612852272264,"msg":"No external lastSync or forced, uploading save."},{"d":1612852275820,"msg":"Synced your save with Dropbox"},{"d":1612852336104,"msg":"No external lastSync or forced, uploading save."},{"d":1612852339945,"msg":"Synced your save with Dropbox"},{"d":1612852400263,"msg":"No external lastSync or forced, uploading save."},{"d":1612852403977,"msg":"Synced your save with Dropbox"},{"d":1612852464267,"msg":"No external lastSync or forced, uploading save."},{"d":1612852467802,"msg":"Synced your save with Dropbox"}],"options":{"hideHigher":false,"hideLower":true,"hideLast":true,"highlight":true,"groupTitlesInLists":true,"thumbnail":true,"originalThumbnail":true,"progressInThumbnail":true,"thumbnailMaxHeight":80,"separateLanguages":true,"favoriteLanguage":"all","saveOpenedChapters":true,"chaptersSaved":100,"saveOnlyHigher":true,"saveOnlyNext":false,"confirmChapter":false,"updateOnlyInList":true,"iconsSilentAfterSync":false,"saveOnLastPage":true,"linkToServices":true,"overviewMainOnly":false,"autoSync":true,"mdUpdateSyncDex":true,"biggerHistory":true,"chapterStatus":false,"notifications":false,"errorNotifications":true,"useMochi":true,"acceptLowScore":false,"updateMD":true,"updateMDProgress":true,"checkOnStartup":true,"checkOnStartupMainOnly":true,"checkOnStartupCooldown":30,"silentUpdate":false,"logLevel":0,"services":["al","mal","ku","mu","ap"],"noReloadStatus":true,"tokens":{},"colors":{"highlights":["rgba(22, 65, 87, 0.8)","rgba(28, 103, 141, 0.8)","rgba(28, 135, 141, 0.8)"],"nextChapter":"rgba(199, 146, 2, 0.9)","higherChapter":"rgba(199, 146, 2, 0.1)","lowerChapter":"rgba(180, 102, 75, 0.4)","openedChapter":"rgba(28, 135, 141, 0.4)"},"version":0.2,"subVersion":11,"mainService":"al"},"saveSync":{"service":"Dropbox","token":"set","expires":1612855374919,"refresh":"set"}}

Additional context only seems to have started happening since the last couple days, so maybe an update in nightly is causing an issue? or an update in the anilist/kitsu API? idk

heres a 2 minute recording of the problem occurring, funnily enough this time the issue didnt occur untilt he second restart of the browser but hopefully it gets the point across. video

Glagan commented 3 years ago

Seems like this is related to Save Sync somehow, I see that your save is downloaded from Dropbox and then the Anilist import fails, the token is not saved in your exported save on external Save Sync services.
But your save shouldn't be downloaded in this example, I'll check what's wrong.

You can disable Dropbox in the meantime if you're not using SyncDex on multiple devices.

Glagan commented 3 years ago

I couldn't reproducet the error the same way you did by restarting, but I now keep the local tokens when downloading a save if the services are the same and that should fix it.

Were you using SyncDex on multiple devices (or browsers) with Dropbox enabled on those, or do you use SyncDex only in one place ?
If you were only using it in one place there's still an error where it download your save for some reasons and I couldn't thing anything, or maybe you manually downloaded your save from Dropbox ?

Anyway, the tokens should not be deleted in the next version (0.2.12).

Jerrk commented 3 years ago

i did indeed have syncdex on 2 separate computers running, both with dropbox enabled, and i can see how that would be an issue. the timing inbetween restarting my browser probably coincided with the dropbox backup task running on the other computer.

how would this interfere with chapter tracking (which it seems that it does) if there are 2 instances of syncdex syncing with dropbox? would one instance always be overwritten by the other which would make the tracking break for one of the browsers?

Glagan commented 3 years ago

Having SyncDex on multiple computers is the expected behavior, the Dropbox sync option was made for that, so your save is synced on an external service and you sync locally with it.
But having two computers at the same time is not expected.

If one computer trigger a sync and upload his local save, the external save is just written over and if progress was send in the meantime it will be lost.
Save Sync also actually check if it's synced only on startup, and then assume it's always synced.
So if one computer is kept open and your save is synced with another computer, you either need to restart your browser on the initial computer or manually import your external save.

You can check if your save is synced by looking at the SyncDex icon if you have it displayed (Firefox only), a blue icon mean it will sync in less than 1 minute, and it's synced if it's green.
You can check that before closing your browser to avoid any error.

I don't know if I will update the logic, since it's made like that to avoid uploading your save too much when you navigate on MangaDex.

If you don't have this error anymore I'll close this issue with the next release.