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

6.4.5 #1258

Merged
merged 19 commits into from
Oct 15, 2024
Merged

6.4.5 #1258

merged 19 commits into from
Oct 15, 2024

Conversation

github-actions[bot]
Copy link

@github-actions github-actions bot commented Oct 12, 2024

  • Fix out-of-memory crash when parsing link previews
  • Fix display of qr-code button when viewing own omemo keys
  • Make discovery of group/channel names more reliable
  • Don't crash on errors when adding a new account
  • Don't leave messages in "Sending..." state after resuming the app from background
  • Allow adding gateway jids as contacts
  • Make group/channel detection more reliable when adding via jid

tmolitor-stud-tu and others added 11 commits August 22, 2024 13:41
Some sites ignore the byterange, make sure to not crash for those sites
if they are big. Also limit the size to 64kb instead of 512kb.
Make the discovery of a room's name more reliable by getting it from the
identity element, which MUST be returned by the MUC service, instead of relying on
muc#roomconfig_roomname, which MAY be returned.

see https://xmpp.org/extensions/xep-0045.html#disco-roominfo
Non-paused timers have a _remainingTime of zero, resuming them will
fast-forward them to firing now. That's not what resume should do -->
log a warning in those cases and ignore the resume instead.
The `@synchronized(self.shared_state)` in `generateEvent:` of
`MLStream.m` was held while calling the delegate from the networking
runloop.

If we now tried to call disconnect in the receiveQueue while still
running the delegate handler (something that can happen because we are
sync dispatching to the receive queue from the delegate), that
disconnect tries to close the MLStream which tries to acquire the
@synchronized lock on the shared MLStream state which is still held by the
networking runloop waiting for the sync receiveQueue dispatch to
complete. (which in turn won't complete because the receiveQueue is still
waiting for the @synchronized in the `[MLStream close]`).

Order of events:
1. Add a block doing a disconnect (or reconnect) to the receiveQueue
2. Call the MLStream delegate with the NSStreamEventOpenCompleted event

This results in the following deadlock cycle:
1. The sync dispatch in the delegate waits for the receiveQueue to
   become available while holding the @synchronized lock on the shared
   MLStream state
2. The disconnect blocks the the receiveQueue while waiting for the
   @synchronized lock to the shared MLStream state to become available

This bug was made more likely to happen when resuming the app from
suspended state by a bug in the MLDelayableTimer implementation fixed in
commit 83e0d34
If you open the settings page on iOS 18.0, the app will crash. On
iOS 17.4, it works fine. The crash happens because UIKit complains that
the account cell is initialised twice.

CRASH(NSInternalInconsistencyException): View was already initialized: <MLSwitchCell: 0x10c03f000; baseClass = UITableViewCell ...>

We initialise the cell for the first time in
MLSettingsTableViewController:tableView:

MLSwitchCell* cell = [tableView dequeueReusableCellWithIdentifier:@"AccountCell" forIndexPath:indexPath];

Just below, we call AccountListController:initContactCell, which
initialises the cell for the second time:

cell = [cell initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"AccountCell"];

We seem to do this so we can mostly resuse the styling defined in the
nib file for AccountCell, but additionally add the subtitle styling
that lets us show the time that the account was last connected. This
approach is recommended here: https://stackoverflow.com/a/40809039

However, this seems incorrect since it leads to the cell being
initialised twice. Probably Apple were not asserting this condition
before, but are now.

So, remove the subtitle from the cell, so that we can fix this crash
for now, and re-add the subtitle later when rewriting the view in
SwiftUI.
XEP-0045 requires a room to
- have an identity with category='conference'
- advertise support for the 'http://jabber.org/protocol/muc' feature

Thus it is more reliable to check for both of these things.
- Make discovery of group/channel names more reliable
- Try to make crashes in link preview less likely
- Don't crash on errors when adding a new account
- Don't leave messages in "Sending..." state after resuming the app from
background
- Allow adding gateway jids as contacts
- Make group/channel detection more reliable when adding via jid
@tmolitor-stud-tu tmolitor-stud-tu marked this pull request as ready for review October 12, 2024 05:57
tmolitor-stud-tu and others added 8 commits October 14, 2024 13:15
This makes OmemoKeysView's top bar visible on iPad when accessed from AccountEdit
Fixes #1259
- Fixed out-of-memory crash when parsing link previews
- Fixed display of qr-code button when viewing own omemo keys
- Fixed out-of-memory crash when parsing link previews
- Fixed display of qr-code button when viewing own omemo keys
@tmolitor-stud-tu tmolitor-stud-tu merged commit 18ca827 into stable Oct 15, 2024
5 checks passed
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