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

Version 2.0.5 #70

Merged
merged 5 commits into from
Jul 3, 2024
Merged

Version 2.0.5 #70

merged 5 commits into from
Jul 3, 2024

Conversation

stelabouras
Copy link
Collaborator

  • Ensures that callbacks won't capture self strongly.
  • Ensures "Designed for iPhone"/ "Designed for iPad" apps use the proper device name.
  • Discloses that completion handlers are called from background threads.
  • Improves cache update after a fetchTranslations call.

Given that the main SDK instance (`tx`) can be set to `nil` using the
`dispose()` method at any time, we need to ensure that the callback
methods of the networking logic (`fetchTranslations`, `pushTranslations`,
`foceCacheInvalidation`) will not capture the instance strongly, retaining
it more than necessary.

In order to address this, the internal `CDSPullRequest` class has been
removed in favor of a private method in the `CDSHandler` class
(`performFetch(...)`) that behaves similarly and ensures that the
network callbacks are capturing a weak reference to the `CDSHandler`
instance.
In device variation rules, the logic uses the iPad device name when the
user interface idiom is Pad,but that does not cover the corner case
where an iOS application targets a Vision device as a 'Designed for iPad'
application.

In order to on par with the logic implemented by Apple, the 'Designed
for iPad' applications on Vision devices, now use the correct device
name. The rest of the cases were also reviewed ('Designed for iPhone' /
'Designed for iPad' iOS apps running either on Mac or Vision devices).

More specifically:

* iPad applications running inside a Mac ("Designed for iPad") return
the "ipad" device name.
* iPhone applications running inside a Mac ("Designed for iPhone")
return the "iphone" device name.
* iPad applications running inside a Vision Pro ("Designed for iPad")
return the "applevision" device name.
* iPhone applications running inside a Vision Pro ("Designed for iPhone")
return the "iphone" device name.
Add documentation on the public methods that accept completion handlers
that the handlers are called from background threads.
After the translations are fetched (pulled) from CDS, the cache is now
updated in the main thread and only if the translations structure is not
empty.
* Bumps `TXNative.version` to 2.0.5.
* Updates CHANGELOG with the changes implemented for 2.0.5.
@stelabouras stelabouras requested a review from n1k0sv July 3, 2024 12:06
@n1k0sv n1k0sv merged commit 663bc36 into transifex:devel Jul 3, 2024
1 check passed
@txsentinel txsentinel mentioned this pull request Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants