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

Release 0.27.4 #1834

Merged
merged 4 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## Changes in 0.27.4 (2023-11-28)

🐛 Bugfixes

- Fix unhandled callback when the session is nil. ([#1833](https://github.com/matrix-org/matrix-ios-sdk/pull/1833))


## Changes in 0.27.3 (2023-10-04)

🐛 Bugfixes
Expand Down
2 changes: 1 addition & 1 deletion MatrixSDK.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "MatrixSDK"
s.version = "0.27.3"
s.version = "0.27.4"
s.summary = "The iOS SDK to build apps compatible with Matrix (https://www.matrix.org)"

s.description = <<-DESC
Expand Down
38 changes: 23 additions & 15 deletions MatrixSDK/Data/MXRoomState.m
Original file line number Diff line number Diff line change
Expand Up @@ -120,23 +120,31 @@ + (void)loadRoomStateFromStore:(id<MXStore>)store
{
[store stateOfRoom:roomId success:^(NSArray<MXEvent *> * _Nonnull stateEvents) {
if (!stateEvents.count) {
MXLogWarning(@"[MXRoomState] loadRoomStateFromStore(%@): No state events stored, loading from api", logId);
MXLogWarning(@"[MXRoomState] loadRoomStateFromStore(%@): No state events stored, loading from API", logId);

[matrixSession.matrixRestClient stateOfRoom:roomId success:^(NSArray *JSONData) {
NSArray<MXEvent *> *events = [MXEvent modelsFromJSON:JSONData];
MXLogDebug(@"[MXRoomState] loadRoomStateFromStore(%@): Loaded %lu events from api", logId, events.count);

[roomState handleStateEvents:events];
onComplete(roomState);
} failure:^(NSError *error) {
NSDictionary *details = @{
@"log_id": logId ?: @"unknown",
@"error": error ?: @"unknown"
};
MXLogErrorDetails(@"[MXRoomState] loadRoomStateFromStore: Failed to load any events from api", details);

if (!matrixSession)
{
MXLogError(@"[MXRoomState] loadRoomStateFromStore: Missing session, unable to load from API")
onComplete(roomState);
}];
}
else
{
[matrixSession.matrixRestClient stateOfRoom:roomId success:^(NSArray *JSONData) {
NSArray<MXEvent *> *events = [MXEvent modelsFromJSON:JSONData];
MXLogDebug(@"[MXRoomState] loadRoomStateFromStore(%@): Loaded %lu events from api", logId, events.count);

[roomState handleStateEvents:events];
onComplete(roomState);
} failure:^(NSError *error) {
NSDictionary *details = @{
@"log_id": logId ?: @"unknown",
@"error": error ?: @"unknown"
};
MXLogErrorDetails(@"[MXRoomState] loadRoomStateFromStore: Failed to load any events from API", details);

onComplete(roomState);
}];
}
} else {
MXLogDebug(@"[MXRoomState] loadRoomStateFromStore(%@): Initializing with %lu state events", logId, stateEvents.count);

Expand Down
2 changes: 1 addition & 1 deletion MatrixSDK/MatrixSDKVersion.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@

#import <Foundation/Foundation.h>

NSString *const MatrixSDKVersion = @"0.27.3";
NSString *const MatrixSDKVersion = @"0.27.4";
Loading