jamulus icon indicating copy to clipboard operation
jamulus copied to clipboard

Fix crash on closing iOS chat dialog

Open ann0see opened this issue 1 year ago • 1 comments

Short description of changes

Using close() instead of hide() would crash the app as soon as one taps at the screen after closing the chat dialog. Due to a null pointer dereference (?). I do not understand why the app crashes. Probably it's a qt bug.

ASSERT failure in QCoreApplication::sendEvent: "Unexpected null receiver", file /Users/qt/work/qt/qtbase/src/corelib/kernel/qcoreapplication.cpp, line 1587

Can't show file for stack frame : <DBGLLDBStackFrame: 0x7fcf61f51120> - stackNumber:3 - name:qAbort. The file path does not exist on the file system: /Users/qt/work/qt/qtbase/src/corelib/global/qglobal.cpp

https://qtcentre.org/threads/5572-QCoreApplication-postEvent-Unexpected-null-receiver (?)

CHANGELOG: iOS: Fix crash on Qt6 after closing the chat window.

Context: Fixes an issue?

Related to: https://github.com/jamulussoftware/jamulus/issues/3406 Does this change need documentation? What needs to be documented and how?

Status of this Pull Request

Ready for review.

What is missing until this pull request can be merged?

Discussion. This is a hot fix...

Checklist

  • [x] I've verified that this Pull Request follows the general code principles
  • [x] I tested my code and it does what I want
  • [ ] My code follows the style guide
  • [ ] I waited some time after this Pull Request was opened and all GitHub checks completed without errors.
  • [ ] I've filled all the content above

ann0see avatar Oct 14 '24 18:10 ann0see

@softins I've pushed a new build with this + the icon PR on TestFlight.

ann0see avatar Oct 19 '24 21:10 ann0see

Thanks for the updated Testflight. I've tried it out, and can confirm it doesn't crash, and the icon looks fine.

But I have found some oddities regarding the Chat window, which while fairly minor, would be worth investigating.

When opening the Chat window, it does not cover the main menu bar, but instead adds its own menu bar below it:

2024-10-24 11 37 42

Closing and re-opening it makes no difference.

This is in contrast to the Settings window, which replaces the main menu bar with its own, and the Connect window, which doesn't have a menu bar at all (it is exited with either Cancel or Connect).

Having connected to a server with a welcome message, the Chat window automatically displayed as usual, but still with the main menu bar showing:

2024-10-24 11 38 40

I closed it, disconnected and connected again to check, and it was the same.

I then tapped in the text box to type a message, and the on-screen keyboard appeared, correctly moving the window upwards. After typing the message and pressing Send, the keyboard disappeared again as normal, but now the Chat window was correctly showing without the main menu bar:

2024-10-24 11 40 52

The very first time I tried this Testflight, and also when I was trying the previous one, the Chat window showed with the message entry box and Send button half off the bottom of the screen. But I have failed to reproduce this behaviour since, so maybe it was a hangover from the older version?

softins avatar Oct 24 '24 11:10 softins

Also, at one point after this, I tapped on Connect in the main window, and the Connect dialog showed at the wrong size:

2024-10-24 11 51 34

Tipping the iPad to rotate to portrait mode and back to landscape mode reset the dialog size to full screen correctly.

I'm not sure what I did to provoke that behaviour.

softins avatar Oct 24 '24 11:10 softins

I did notice problems like this on the main mixer board too. All can be fixed by rotating the device.

I believe it's due to an overflow introduced by some widget (see the UI issues mentioned in https://github.com/jamulussoftware/jamulus/issues/3406)

ann0see avatar Oct 24 '24 11:10 ann0see

Maybe https://github.com/jamulussoftware/jamulus/pull/3397 Could fix this. I'd like to investigate the UI issues separately.

ann0see avatar Oct 24 '24 11:10 ann0see

Maybe #3397 Could fix this. I'd like to investigate the UI issues separately.

Fair enough. As this PR fixes the crash it's supposed to, I'm happy to approve and leave the UI for separate investigation.

softins avatar Oct 24 '24 11:10 softins

@gilgongo @pljones Not sure if you can test this, but I'd like this to be merged.

The TestFlight link is in the chat.

ann0see avatar Nov 12 '24 22:11 ann0see

I've no way to test it.

pljones avatar Nov 13 '24 09:11 pljones

I'm unable to test on iOS either.

gilgongo avatar Nov 13 '24 09:11 gilgongo

Can we get this merged and cut a development release so any iOS users have a release they can install and test? If it breaks, we can revert it.

pljones avatar Dec 12 '24 17:12 pljones

Yes, sure

ann0see avatar Dec 12 '24 20:12 ann0see