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

Implement the Subscription type #22

Merged
merged 2 commits into from
Aug 26, 2024

Conversation

lawrence-forooghian
Copy link
Collaborator

Note: This PR is based on top of #9; please review that one first.

This implements the Subscription type from #9. It’s a bit messy, but we should be able to get rid of it if we switch to Swift 6 once that's released (see #21).

@lawrence-forooghian lawrence-forooghian changed the base branch from main to 7-public-api August 22, 2024 14:25
@lawrence-forooghian lawrence-forooghian marked this pull request as ready for review August 22, 2024 14:26
@lawrence-forooghian lawrence-forooghian marked this pull request as draft August 22, 2024 14:38
@lawrence-forooghian

This comment was marked as outdated.

@lawrence-forooghian lawrence-forooghian force-pushed the implement-Subscription branch 5 times, most recently from 4dd98f5 to 6e82605 Compare August 22, 2024 17:00
@lawrence-forooghian lawrence-forooghian marked this pull request as ready for review August 22, 2024 17:11
Copy link
Collaborator

@maratal maratal left a comment

Choose a reason for hiding this comment

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

Left some questions.

Sources/AblyChat/Subscription.swift Outdated Show resolved Hide resolved
Sources/AblyChat/Subscription.swift Show resolved Hide resolved
Sources/AblyChat/Subscription.swift Show resolved Hide resolved
Sources/AblyChat/Subscription.swift Show resolved Hide resolved
Copy link
Collaborator

@maratal maratal left a comment

Choose a reason for hiding this comment

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

Waiting for MessageSubscription to be implemented as mentioned by Lawrence.

It offers some nice convenience features.

I don’t think that this package is a controversial inclusion; it’s
written by Apple and they had a WWDC session about it.

This is the first time I’ve tried adding a new package, and for some
reason Xcode didn’t update its xcshareddata Package.resolved
automatically, but running `xcodebuild -resolvePackageDependencies` did
the trick.

Adding this package exposed a couple of issues in our CI setup:

1. the way in which we specify which Swift language version to use —
   I’ve fixed this
2. Xcode can fail when trying to compile a Package.swift package using
   “treat warnings as errors” — I’ve had to turn that off
@lawrence-forooghian lawrence-forooghian force-pushed the implement-Subscription branch 2 times, most recently from 202f70a to a7ec146 Compare August 24, 2024 15:46
@lawrence-forooghian
Copy link
Collaborator Author

Waiting for MessageSubscription to be implemented as mentioned by Lawrence.

Done this now.

@lawrence-forooghian
Copy link
Collaborator Author

Made the changes but have a compilation error to fix; might require some changes to #7. Will look into it.

@lawrence-forooghian
Copy link
Collaborator Author

OK, sorted it.

Copy link
Collaborator

@maratal maratal left a comment

Choose a reason for hiding this comment

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

Left few questions.

Note that XCTAssertEqual doesn’t allow you to write `await` inside its
arguments, hence the indirection to get the result of a couple of `async
let`s. Hopefully we’ll be able to migrate to Swift Testing at some
point, which will resolve this; see #21.

I’ve also implemented MessageSubscription by wrapping Subscription.
Copy link
Collaborator

@maratal maratal left a comment

Choose a reason for hiding this comment

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

LGTM

@lawrence-forooghian lawrence-forooghian merged commit 1089a3a into 7-public-api Aug 26, 2024
17 checks passed
@lawrence-forooghian lawrence-forooghian deleted the implement-Subscription branch August 26, 2024 17:24
@lawrence-forooghian lawrence-forooghian restored the implement-Subscription branch August 27, 2024 07:57
@lawrence-forooghian lawrence-forooghian deleted the implement-Subscription branch August 29, 2024 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants