Skip to content

A bunch of fixes#9902

Merged
NiLuJe merged 9 commits into
koreader:masterfrom
NiLuJe:master
Dec 12, 2022
Merged

A bunch of fixes#9902
NiLuJe merged 9 commits into
koreader:masterfrom
NiLuJe:master

Conversation

@NiLuJe

@NiLuJe NiLuJe commented Dec 11, 2022

Copy link
Copy Markdown
Member

(Rebase me)


This change is Reviewable

@NiLuJe

NiLuJe commented Dec 11, 2022

Copy link
Copy Markdown
Member Author

(Draft because I still have others things planned for tonight, but wanted to braindump a few things first)

@NiLuJe

NiLuJe commented Dec 11, 2022

Copy link
Copy Markdown
Member Author

Namely, AFAICT, the nextTick nastiness in reader.lua (from all the way back to #1877) is completely unnecessary, as #1988 enforced a repaint after the popup in question, and that has no bearing on the state of the main loop, it will repaint now.

@yparitcher

Copy link
Copy Markdown
Member

I Just debugged this, (I had suspected that commit) and came to comment when i saw this :)

My fix was just to add a line:

    self._exit_code = nil

to the beginning of UIManager:run() without the whole run once function

@yparitcher

Copy link
Copy Markdown
Member

it is the self._exit_code being leaked across runs of UIManager

@NiLuJe

NiLuJe commented Dec 11, 2022

Copy link
Copy Markdown
Member Author

Yup! I'd rather be overly explicit to document this and avoid a future regression if we lost this to the sands of time, though ;).

(And also to actually skip the :quit() call, because it might not always stay as mostly harmless as it is today).

@NiLuJe NiLuJe force-pushed the master branch 2 times, most recently from d650e3b to 9b72f37 Compare December 12, 2022 00:26
Comment thread frontend/docsettings.lua Outdated
@NiLuJe

NiLuJe commented Dec 12, 2022

Copy link
Copy Markdown
Member Author

Namely, AFAICT, the nextTick nastiness in reader.lua (from all the way back to #1877) is completely unnecessary, as #1988 enforced a repaint after the popup in question, and that has no bearing on the state of the main loop, it will repaint now.

Confirmed when testing the Kindle stuff on a slow PW1: it works just fine.

@Frenzie Frenzie added this to the 2022.12 milestone Dec 12, 2022
@NiLuJe NiLuJe marked this pull request as ready for review December 12, 2022 07:15
@NiLuJe NiLuJe requested review from Frenzie and pazos as code owners December 12, 2022 07:15
@NiLuJe

NiLuJe commented Dec 12, 2022

Copy link
Copy Markdown
Member Author

Kindle t1 timeout trickery seems to behave, yay.

Comment thread frontend/ui/uimanager.lua Outdated
@poire-z

poire-z commented Dec 12, 2022

Copy link
Copy Markdown
Contributor

ReaderHighlight: Appease newer versions of LuaCheck
Good to know: it now defaults to assuming that anything
prefixed with an underscore would be unused, which is... nice in theory ;).

Well, does that mean it won't complain when we have unused:

local _ = require("gettext")
local _mirroredUI = BD.mirroredUILayout()
local _start_seg = end_seg + icon_sep_width

But mhhh, what does it complain about if it can assume they are unused ? :)

@NiLuJe

NiLuJe commented Dec 12, 2022

Copy link
Copy Markdown
Member Author

ReaderHighlight: Appease newer versions of LuaCheck
Good to know: it now defaults to assuming that anything
prefixed with an underscore would be unused, which is... nice in theory ;).

Well, does that mean it won't complain when we have unused:

local _ = require("gettext")
local _mirroredUI = BD.mirroredUILayout()
local _start_seg = end_seg + icon_sep_width

But mhhh, what does it complain about if it can assume they are unused ? :)

Weeeeell, I have no idea what's happening then :D.

Checking foo.lua                                  5 warnings

    foo.lua:2:7-17: (W211) unused variable _mirroredUI
    foo.lua:2:21-22: (W113) accessing undefined variable BD
    foo.lua:3:7-16: (W211) unused variable _start_seg
    foo.lua:3:20-26: (W113) accessing undefined variable end_seg
    foo.lua:3:30-43: (W113) accessing undefined variable icon_sep_width

Total: 5 warnings / 0 errors in 4 files

@NiLuJe

NiLuJe commented Dec 12, 2022

Copy link
Copy Markdown
Member Author

Weeeeell, I have no idea what's happening then :D.

Mystery solved: it's when function arguments are prefixed.

local function foo(_bar, baz)
        return _bar + baz
end
Checking foo.lua                                  2 warnings

    foo.lua:1:16-18: (W211) unused function foo
    foo.lua:1:20-23: (W214) used variable _bar with unused hint

Total: 2 warnings / 0 errors in 4 files

Good to know: it now defaults to assuming that function arguments
prefixed with an underscore would be unused, which is... nice in theory ;).
e.g., on the Sage, only the power_dev stuff changes between HW revs,
the rest of the hardcoded stuff is still relevant, so skip probing
those.
the main one *always* has priority, regardless of mtime.

Should help workaround weird local/UTC issues when USBMS is involved,
c.f., koreader#9227 (comment)
Use the same mtime (the newest) for both entries, so that priority order
wins the tie, giving priority to the primary.

Avoids preferring an older legacy sidecar in case of issues with the new
files.
@NiLuJe NiLuJe merged commit be42cac into koreader:master Dec 12, 2022

@NiLuJe NiLuJe left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 2 of 5 files at r1, 8 of 8 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion

NiLuJe added a commit to NiLuJe/koreader that referenced this pull request Jan 6, 2023
Regression since koreader#9902, because I'd forgotten that the default Kobo
block *does* set those...

Reported by @ptrm on Gitter, thanks!
NiLuJe added a commit that referenced this pull request Jan 6, 2023
Regression since #9902, because I'd forgotten that the default Kobo block *does* set those...
Reported by @ptrm on Gitter, thanks!

Take two, essentially revert 8a16518
We have defaults for most of those in the Kobo superclass, so these can never really be `nil`.
0xstillb pushed a commit to 0xstillb/koreader-thai that referenced this pull request May 9, 2026
Regression since koreader#9902, because I'd forgotten that the default Kobo block *does* set those...
Reported by @ptrm on Gitter, thanks!

Take two, essentially revert 5974425
We have defaults for most of those in the Kobo superclass, so these can never really be `nil`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Exit after unable to find last file 2022.11 regression on kindle PW3: swipe to unlock!? FR: Disable screensaver AutoSuspend Timeout issue

4 participants