diff --git a/.github/workflows/detox-ios-beta.yml b/.github/workflows/detox-ios-beta.yml index 4756efcd3e..0bf99aba1c 100644 --- a/.github/workflows/detox-ios-beta.yml +++ b/.github/workflows/detox-ios-beta.yml @@ -5,7 +5,7 @@ on: jobs: detox-ios: - timeout-minutes: 20 + timeout-minutes: 25 runs-on: [macos-latest-xlarge] steps: @@ -58,7 +58,6 @@ jobs: detox build -c ios.sim.debug.ci - name: Run basic tests - continue-on-error: true run: | cd packages/mobile detox test starter -c ios.sim.debug.ci @@ -67,12 +66,11 @@ jobs: run: pm2 stop METRO - name: Take screenshot - continue-on-error: true + if: always() run: | /usr/bin/xcrun simctl io booted screenshot screenshot.png - name: Upload screenshot - continue-on-error: true uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 with: name: screenshot.png diff --git a/packages/mobile/ios/Quiet/AppDelegate.m b/packages/mobile/ios/Quiet/AppDelegate.m index 017f61afb9..98f0f91b90 100644 --- a/packages/mobile/ios/Quiet/AppDelegate.m +++ b/packages/mobile/ios/Quiet/AppDelegate.m @@ -51,11 +51,14 @@ - (void) initWebsocketConnection { * Delay used below can't cause any race condition as websocket won't connect until data server starts listening anyway. */ dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{ - NSTimeInterval delayInSeconds = 90; - dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC)); - dispatch_after(popTime, dispatch_get_main_queue(), ^(void) { - [[self.bridge moduleForName:@"CommunicationModule"] sendDataPortWithPort:self.dataPort socketIOSecret:self.socketIOSecret]; - }); + NSArray *intervals = @[@5, @30, @60, @90]; + for (NSNumber *interval in intervals) { + NSTimeInterval delayInSeconds = [interval doubleValue]; + dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC)); + dispatch_after(popTime, dispatch_get_main_queue(), ^(void) { + [[self.bridge moduleForName:@"CommunicationModule"] sendDataPortWithPort:self.dataPort socketIOSecret:self.socketIOSecret]; + }); + } }); } diff --git a/packages/mobile/src/store/init/startConnection/startConnection.saga.ts b/packages/mobile/src/store/init/startConnection/startConnection.saga.ts index 5a4d63ce1b..6cf1f49ef3 100644 --- a/packages/mobile/src/store/init/startConnection/startConnection.saga.ts +++ b/packages/mobile/src/store/init/startConnection/startConnection.saga.ts @@ -10,6 +10,9 @@ import { eventChannel } from 'redux-saga' export function* startConnectionSaga( action: PayloadAction['payload']> ): Generator { + const isAlreadyConnected = yield* select(initSelectors.isWebsocketConnected) + if (isAlreadyConnected) return + const { dataPort, socketIOSecret } = action.payload console.log('WEBSOCKET', 'Entered start connection saga', dataPort)