File tree Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
7
7
### ✅ Added
8
8
- Add support for deleting messages only for the current user [ #3836 ] ( https://github.com/GetStream/stream-chat-swift/pull/3836 )
9
9
- Add ` ChatMessageController.deleteMessageForMe() `
10
- - Add ` ChatMessage.deletedForMe `
10
+ - Add ` ChatMessage.deletedForMe `
11
+ ### 🐞 Fixed
12
+ - Fix logout not clearing token when current user had no device registered [ #3838 ] ( https://github.com/GetStream/stream-chat-swift/pull/3838 )
11
13
12
14
# [ 4.90.0] ( https://github.com/GetStream/stream-chat-swift/releases/tag/4.90.0 )
13
15
_ October 07, 2025_
Original file line number Diff line number Diff line change @@ -515,14 +515,13 @@ public class ChatClient {
515
515
}
516
516
self ? . authenticationRepository. logOutUser ( )
517
517
}
518
+ } else {
519
+ authenticationRepository. logOutUser ( )
518
520
}
519
521
522
+ // Clear current user id instantly even if pending removing device.
520
523
authenticationRepository. clearCurrentUserId ( )
521
524
522
- if removeDevice == false {
523
- authenticationRepository. logOutUser ( )
524
- }
525
-
526
525
// Stop tracking active components
527
526
syncRepository. removeAllTracked ( )
528
527
Original file line number Diff line number Diff line change @@ -340,7 +340,7 @@ final class ChatClient_Tests: XCTestCase {
340
340
XCTAssertEqual ( testEnv. apiClient? . request_endpoint? . method, . delete)
341
341
}
342
342
343
- func test_logout_whenNoCurrentDevice_doesNotRemoveDevice ( ) throws {
343
+ func test_logout_whenNoCurrentDevice_doesNotRemoveDevice_shouldClearToken ( ) throws {
344
344
// GIVEN
345
345
let client = ChatClient (
346
346
config: inMemoryStorageConfig,
@@ -363,6 +363,7 @@ final class ChatClient_Tests: XCTestCase {
363
363
364
364
// THEN
365
365
XCTAssertCall ( ConnectionRepository_Mock . Signature. disconnect, on: testEnv. connectionRepository!)
366
+ XCTAssertCall ( AuthenticationRepository_Mock . Signature. logOut, on: testEnv. authenticationRepository!)
366
367
XCTAssertNil ( testEnv. apiClient? . request_endpoint? . path)
367
368
XCTAssertNil ( testEnv. apiClient? . request_endpoint? . method)
368
369
}
You can’t perform that action at this time.
0 commit comments