Skip to content

Revert "Kosync network callback"#6535

Merged
Frenzie merged 1 commit into
masterfrom
revert-6489-kosync-network-callback
Aug 20, 2020
Merged

Revert "Kosync network callback"#6535
Frenzie merged 1 commit into
masterfrom
revert-6489-kosync-network-callback

Conversation

@Galunid

@Galunid Galunid commented Aug 20, 2020

Copy link
Copy Markdown
Member

Reverts #6489 since it introduced problems for people having [*]Auto sync now and in the furture & Action when wifi off: prompt.


This change is Reviewable

@Frenzie Frenzie added this to the 2020.08.1 milestone Aug 20, 2020
@Frenzie Frenzie merged commit 85b498d into master Aug 20, 2020
@NiLuJe

NiLuJe commented Aug 20, 2020

Copy link
Copy Markdown
Member

Now that I'm back, remind me what was the issue that made you try this approach?

@Frenzie Frenzie deleted the revert-6489-kosync-network-callback branch August 20, 2020 11:11
@Galunid

Galunid commented Aug 20, 2020

Copy link
Copy Markdown
Member Author

@NiLuJe Kosync plugin doesn't adapt to your QoL wifi improvements, i.e. doesn't enable wifi when pushing/pulling progress and disabling it after. It just displays message along the lines of "Something went wrong, check your network"

@NiLuJe

NiLuJe commented Aug 20, 2020

Copy link
Copy Markdown
Member

@Galunid: On which device?

@NiLuJe

NiLuJe commented Aug 20, 2020

Copy link
Copy Markdown
Member

Ah, yeah, KOSync:getProgress and KOSync:updateProgress may be called without Wi-Fi (i.e., pagination).

There's not really much we can do, as they may be called at a lot of weird moments, and, the rerunWhenOnline stuff will (as it should) always show the relevant UI bits.

That said, on Kobo, with restore Wi-Fi on resume, it should behave properly in most cases, as it's frequent enough (I think?), that it should keep Wi-Fi alive.

@NiLuJe

NiLuJe commented Aug 20, 2020

Copy link
Copy Markdown
Member

Frequent enough given an appropriate DAUTO_SAVE_PAGING_COUNT. Since that's gone now, a better fix would probably to make that threshold an actual plugin setting, as per the TODO ;).

@Galunid

Galunid commented Aug 20, 2020

Copy link
Copy Markdown
Member Author

Yes, actually that's the reason I disabled Auto progress sync, since those weird times hung the device for ~30s. A better way to handle this would be to check if manual == true was passed when calling

function KOSync:getProgress(manual)
if not self.kosync_username or not self.kosync_userkey then
if manual then
promptLogin()
end
return
end
local KOSyncClient = require("KOSyncClient")
local client = KOSyncClient:new{
custom_url = self.kosync_custom_server,
service_spec = self.path .. "/api.json"
}

So if user called it, enable wifi, otherwise skip.

0xstillb pushed a commit to 0xstillb/koreader-thai that referenced this pull request May 9, 2026
This reverts commit 8d0c369. Reverts koreader#6489 since it introduced problems for people having [*]Auto sync now and in the furture & Action when wifi off: prompt.
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.

3 participants