Kosync network callback#6489
Conversation
4f5b91f to
f16aa61
Compare
| @@ -1,4 +1,5 @@ | |||
| local UIManager = require("ui/uimanager") | |||
| local NetworkMgr = require("ui/network/manager") | |||
|
That plug-in should already have an onNetworkConnected handler, so I'm not quite sure what this is attempting to fix? Android? (Because the events are unreliable there). I'd much rather fix the events and/or the handler than adding a hack in this specific plug-in ;). (On mobile, so context is a bit gnarly to grok). |
|
@NiLuJe It was supposed to fix it on my Kobos, tested it before(latest nightly) on both and none worked ;/ koreader/plugins/kosync.koplugin/main.lua Lines 297 to 300 in 66e70fc I assumed you missed those two functions. As for onNetworkConnected, the only thing it does is koreader/plugins/kosync.koplugin/main.lua Lines 695 to 697 in 66e70fc onNetworkManager calls _onNetworkManager, which in turn calls _onResume. Pushing/pulling progress with Wi-Fi off basically results in a massage like Something went wrong, check network.
|
|
I'm not in a position to actually review this for another week, but then again, I don't actually use the plugin, so if it works for you, that's fine enough by me ;). |
Frenzie
left a comment
There was a problem hiding this comment.
I still find it a bit confusing but I don't want to look into this one more deeply. :-)
…ore reliable (#10605) Fix: #10539, and for context #6489, #6733, #6534 Reorganize and reword most of the settings to make it clear what actually ties into auto sync, and what doesn't. (Specifically, what happens when a pull attempts to sync forward or backward has nothing to do with auto sync, it applies in all cases; while the periodic sync *does* require auto sync). The main point of contention, though, is that auto sync will now *always* attempt to setup network connectivity (i.e., on resume/suspend/close). Periodic sync will *not* though (the intent being that, if you use periodic sync, you're relying on the activity check to actually keep wifi on at all times)). Since this may lead to a large amount of nagging about wifi toggles on devices w/ NetworkManager support, it is now *disabled* by default on those devices. (And given that it wouldn't have worked because of the lack of connectivity, that doesn't really make any practical difference ;p). Additionally, given the fact that there's no way to make this behavior viable if the "before wifi" action is left at its default of "prompt", this feature now *requires* that to be set to "turn_on" (on devices where it can, of course); attempting to toggle it on will warn about that if necessary. This change is retroactive (OTM). Includes an assortment of fixes and cleanups, including migrating to the new LuaSettings API, which is why there's no longer a smattering of superfluous flushes.
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.
…ore reliable (koreader#10605) Fix: koreader#10539, and for context koreader#6489, koreader#6733, koreader#6534 Reorganize and reword most of the settings to make it clear what actually ties into auto sync, and what doesn't. (Specifically, what happens when a pull attempts to sync forward or backward has nothing to do with auto sync, it applies in all cases; while the periodic sync *does* require auto sync). The main point of contention, though, is that auto sync will now *always* attempt to setup network connectivity (i.e., on resume/suspend/close). Periodic sync will *not* though (the intent being that, if you use periodic sync, you're relying on the activity check to actually keep wifi on at all times)). Since this may lead to a large amount of nagging about wifi toggles on devices w/ NetworkManager support, it is now *disabled* by default on those devices. (And given that it wouldn't have worked because of the lack of connectivity, that doesn't really make any practical difference ;p). Additionally, given the fact that there's no way to make this behavior viable if the "before wifi" action is left at its default of "prompt", this feature now *requires* that to be set to "turn_on" (on devices where it can, of course); attempting to toggle it on will warn about that if necessary. This change is retroactive (OTM). Includes an assortment of fixes and cleanups, including migrating to the new LuaSettings API, which is why there's no longer a smattering of superfluous flushes.
I found that KOSync doesn't work with #6424 and since it was pretty simple I fixed it.
This change is