Skip to content

Commit

Permalink
Merge branch 'release/0.27.4/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
pixlwave committed Nov 28, 2023
2 parents ebae216 + dbdc541 commit dbec252
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 18 deletions.
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";
2 changes: 1 addition & 1 deletion Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 1bf28f5a19566c567d265232f60ee19a3ae86ed3

COCOAPODS: 1.11.3
COCOAPODS: 1.13.0

0 comments on commit dbec252

Please sign in to comment.