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

No-connection-serial implementation #1496

Closed
wants to merge 199 commits into from

Conversation

ikbalkaya
Copy link
Contributor

@ikbalkaya ikbalkaya commented Sep 14, 2022

No connection-serial implementation for ably-cocoa
Closes #1494

This also includes changes here
However, in ably-cocoa there is no mandatory version param for rest request so no change there.

@github-actions github-actions bot temporarily deployed to staging/pull/1496/jazzydoc September 14, 2022 09:23 Inactive
Including all references. Also some tests has been removed as new spec rendered them useless. Some methods with connection serial parameters are refactored to function without it. Subsequent commit will make any change that's necessary, following the spec document
@github-actions github-actions bot temporarily deployed to staging/pull/1496/jazzydoc September 14, 2022 13:27 Inactive
Also remove _lastPayloadProtocolMessageChannelSerial and perform updates based on RTL15b
@github-actions github-actions bot temporarily deployed to staging/pull/1496/jazzydoc September 14, 2022 17:14 Inactive
This is RTN15c6. Also removes RTN15c3 (that will be replaced by RTN15c7 later)
@github-actions github-actions bot temporarily deployed to staging/pull/1496/jazzydoc September 15, 2022 14:05 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1496/jazzydoc September 15, 2022 16:53 Inactive
This also refactors reattach behaviour for RTN15c6 and RTN15c7
@github-actions github-actions bot temporarily deployed to staging/pull/1496/jazzydoc September 15, 2022 17:20 Inactive
Also implement RTN16f, RTN16j and potentially RTN16i. Also updated the references to the recovery key so that key is now a JSON string
@github-actions github-actions bot temporarily deployed to staging/pull/1496/jazzydoc September 16, 2022 14:25 Inactive
Also add fromJson method and turn toJson into a method. I did not throw exception in case of serialization / deserialization failure and instead logged the error
As described in RTN16g getRecoveryKey() will return a string rather than an object. Object will be used only internally
@github-actions github-actions bot temporarily deployed to staging/pull/1496/jazzydoc September 20, 2022 13:08 Inactive
As described in RTN16k. Also recovery key is being used as provided by client options and not from connection
As described with RTP5a1, Switch branch seems a bit fragile here with some returns for some cases - Needs to re-checked
As described in RTP17f. However the method of reentry needs to be checked to see if it should rather be through event emitter. There are so many redirections in this repo
As described in RTP17g. Also remove reentries on sync and sync completion. I might need to check whether reentry can be invoked from presenceMap
It was marked as nonull instead of nonatomic
Was calling state directly which caused data race issues
@maratal maratal force-pushed the integration/no_connection_time_serial branch from c00b0b6 to 4c5fd67 Compare April 3, 2023 12:08
@github-actions github-actions bot temporarily deployed to staging/pull/1496/features April 3, 2023 12:09 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1496/jazzydoc April 3, 2023 12:15 Inactive
@maratal maratal force-pushed the integration/no_connection_time_serial branch 4 times, most recently from 857efcb to 4c5fd67 Compare April 3, 2023 21:53
maratal added 2 commits April 3, 2023 23:55
…tion_time_serial

# Conflicts:
#	Source/ARTRealtime.m
#	Source/ARTRealtimeChannel.m
#	Source/PrivateHeaders/Ably/ARTRealtimeChannel+Private.h
#	Source/PrivateHeaders/Ably/ARTWebSocketTransport+Private.h
@maratal maratal force-pushed the integration/no_connection_time_serial branch from 0b58eee to 9708959 Compare April 9, 2023 13:57
@maratal
Copy link
Collaborator

maratal commented Apr 10, 2023

@lawrence-forooghian I've incorporated ARTResumeRequestResponse (somewhat) - d573560, couldn't you comment on these changes whether I'm on the right track with them. Also I would suggest to rename this new class to ARTConnectionRequestResponse since it's not always resume - the very first is not a resume and a failed one is not a resume as well. WDYT?

…tion_time_serial

# Conflicts:
#	Source/ARTRealtime.m
#	Source/ARTWebSocketTransport.m
#	Source/PrivateHeaders/Ably/ARTWebSocketTransport.h
@lawrence-forooghian
Copy link
Collaborator

Thanks @maratal, I'll take a look at it. As for your question, it's called ARTResumeRequestResponse because that's the language used by RTN15c, which talks about "the system’s response to a resume request".

the very first is not a resume and a failed one is not a resume as well

That's correct. That means that it is not appropriate to use ARTResumeRequestResponse in those cases. As its documentation says, to create it you need "the ID of the connection that we are trying to resume" and "the first protocol message received on a transport which is trying to resume a connection with ID currentConnectionID", so in a scenario where it's not possible to provide those things then we shouldn't be using this class.

Does that help?

[self.logger warn:@"RT:%p connection \"%@\" has resumed with non-fatal error \"%@\"", self, message.connectionId, message.error.message];
[self resetSerials];
}
else if (response.type == ARTResumeRequestResponseTypeFatalError || response.type == ARTResumeRequestResponseTypeTokenError) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not a switch here?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, but I'm rewriting this piece anyway.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why have all of the workflows been deleted on this branch?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I temporarily remove other workflows to not to wait while all of them finish when I try things (yes, I should move PR to draft in this case, but here I needed some feedback from you).

@maratal maratal marked this pull request as draft April 12, 2023 20:48
maratal added 2 commits April 12, 2023 23:30
…tion_time_serial

# Conflicts:
#	Source/ARTPresenceMap.m
#	Source/ARTRealtime.m
#	Source/ARTRealtimeChannel.m
#	Source/ARTWebSocketTransport.m
#	Source/PrivateHeaders/Ably/ARTConnection+Private.h
#	Source/PrivateHeaders/Ably/ARTProtocolMessage+Private.h
#	Source/PrivateHeaders/Ably/ARTRealtime+Private.h
#	Source/PrivateHeaders/Ably/ARTRealtimeChannel+Private.h
#	Source/PrivateHeaders/Ably/ARTRealtimePresence+Private.h
#	Source/PrivateHeaders/Ably/ARTRealtimeTransport.h
#	Source/PrivateHeaders/Ably/ARTWebSocketTransport.h
#	Source/include/Ably/ARTProtocolMessage.h
@maratal maratal force-pushed the integration/no_connection_time_serial branch from 29c21c1 to 5ad2f43 Compare April 12, 2023 22:53
maratal added 3 commits April 14, 2023 20:51
…tion_time_serial

# Conflicts:
#	Source/ARTRealtime.m
#	Source/ARTWebSocketTransport.m
#	Source/PrivateHeaders/Ably/ARTRealtimeTransport.h
#	Test/Tests/RealtimeClientConnectionTests.swift
…tion_time_serial

# Conflicts:
#	.github/workflows/integration-test-iOS16_2.yaml
#	.github/workflows/integration-test-tvOS16_1.yaml
#	Source/ARTRealtime.m
#	Source/PrivateHeaders/Ably/ARTRealtimeTransport.h
#	Test/Tests/RealtimeClientChannelTests.swift
#	Test/Tests/RealtimeClientConnectionTests.swift
#	Test/Tests/RealtimeClientPresenceTests.swift
…tion_time_serial

# Conflicts:
#	Source/ARTRealtimeTransportFactory.m
#	Source/ARTWebSocketTransport.m
#	Source/PrivateHeaders/Ably/ARTWebSocketTransport.h
#	Test/Test Utilities/TestProxyTransportFactory.swift
#	Test/Test Utilities/TestUtilities.swift
@lawrence-forooghian
Copy link
Collaborator

Closing this — replaced by #1714.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improved functionality.
Development

Successfully merging this pull request may close these issues.

[ably-cocoa] Implement no-connection-serial
6 participants