Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Message selecting crash #93

Closed
fluxionary opened this issue May 30, 2023 · 9 comments
Closed

Message selecting crash #93

fluxionary opened this issue May 30, 2023 · 9 comments
Labels
Bug Something isn't working
Milestone

Comments

@fluxionary
Copy link
Member

i'm not sure what triggered this.

running 02853fc, though it doesn't look like the commits since would affect this.

2023-05-28 21:04:03: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'mail' in callback on_playerReceiveFields(): ...t/5.6.1/Minetest_live/bin/../mods/mail_mod/ui/events.lua:85: attempt to index a nil value
2023-05-28 21:04:03: ERROR[Main]: stack traceback:
2023-05-28 21:04:03: ERROR[Main]: 	...t/5.6.1/Minetest_live/bin/../mods/mail_mod/ui/events.lua:85: in function 'func'
2023-05-28 21:04:03: ERROR[Main]: 	...inetest_live/bin/../builtin/profiler/instrumentation.lua:107: in function <...inetest_live/bin/../builtin/profiler/instrumentation.lua:100>
2023-05-28 21:04:03: ERROR[Main]: 	.../mt/5.6.1/Minetest_live/bin/../builtin/game/register.lua:431: in function <.../mt/5.6.1/Minetest_live/bin/../builtin/game/register.lua:417>
@Athozus Athozus added the Bug Something isn't working label May 30, 2023
@Athozus Athozus added this to the 1.2.0 milestone May 30, 2023
@Athozus
Copy link
Member

Athozus commented May 30, 2023

@fluxionary
Copy link
Member Author

Do you have more details ?

unfortunately not currently. this was on a multiplayer server. i don't know who did what, and i wasn't able to replicate it locally. i might be able to get the data from on_player_receive_fields from the server owner, waiting to hear back about that.

@fluxionary
Copy link
Member Author

the last recorded submission was

formspec "mail:inbox": tour submitted {"filter":"haven","inbox":"CHG:11:3","sortdirection":"2","sortfield":"3"}

though the timestamp was a couple minutes before the crash, so i'm not sure it's related.

@fluxionary
Copy link
Member Author

got another crash, this was the last received form fields:

formspec "mail:inbox": FullmetalBOI submitted {"filter":"w","inbox":"CHG:40:3","sortdirection":"1","sortfield":"3"}

@Athozus Athozus changed the title crash Inbox selecting crash Jun 2, 2023
@Athozus
Copy link
Member

Athozus commented Jun 2, 2023

Apparently mail.selected_idxs.inbox[name] seems to be always accessible, to the problematic part might be getInbox()[evt.row-1].id. The problem is determining if it's getInbox() indexation or .id. I think that getInbox() cannot be the problem as it's displayed just before, but I'm not sure. Do you have any steps to reproduce ?

@fluxionary
Copy link
Member Author

Do you have any steps to reproduce ?

not yet, but the issue is happening once a day or so, it's only a matter of time until i'm able to get info from someone about what they were doing when the server crashed.

@fluxionary
Copy link
Member Author

fluxionary commented Jun 11, 2023

we got a similar crash w/ the outbox instead of the inbox

2023-06-10 23:35:33: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'mail' in callback on_playerReceiveFields(): ...t/5.7.0/Minetest_live/bin/../mods/mail_mod/ui/events.lua:123: attempt to index a nil value
2023-06-10 23:35:33: ERROR[Main]: stack traceback:
2023-06-10 23:35:33: ERROR[Main]: 	...t/5.7.0/Minetest_live/bin/../mods/mail_mod/ui/events.lua:123: in function 'func'
2023-06-10 23:35:33: ERROR[Main]: 	...inetest_live/bin/../builtin/profiler/instrumentation.lua:108: in function <...inetest_live/bin/../builtin/profiler/instrumentation.lua:101>
2023-06-10 23:35:33: ERROR[Main]: 	.../mt/5.7.0/Minetest_live/bin/../builtin/game/register.lua:446: in function <.../mt/5.7.0/Minetest_live/bin/../builtin/game/register.lua:432>

last formspec submission:

formspec "mail:sent": shawnmc submitted {"filter":"ffffff","sent":"CHG:2:3","sortdirection":"1","sortfield":"3"}

the trigger seems to be something to do w/ selecting mail while a filter is applied. i haven't been able to replicate it yet though.

@Athozus
Copy link
Member

Athozus commented Jun 13, 2023

Thanks a lot for that report. I will work on it, that's really strange o_O.

@Athozus Athozus changed the title Inbox selecting crash Message selecting crash Jun 13, 2023
@Athozus
Copy link
Member

Athozus commented Jun 14, 2023

Thanks to whosit (from Your Land) we understood the bug. It is due to, when you enter a filter but you directly click on the table without clicking on Q (to search), the fact is that the formspec receives the data, but the row number can be higher than the total of rows from the updated table, so it makes a nil. An easy fix to avoid that is to do { (getInbox()[evt.row-1] or {}).id } as he suggested on https://gitea.your-land.de/your-land/bugtracker/issues/4640#issuecomment-53837. Another solutions are there :

  1. A pressed Q is needed to apply the filter (else it's reseted to previous value)
  2. Indexes are checked before updating the message list

Thanks a lot to whosit, he helped us a lot and I'm pretty sure it's related to #84

Athozus added a commit that referenced this issue Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants