Skip to content

Simplified code to use FCM token type as default - #727

Merged
QuintinWillison merged 10 commits into
integration/version-2from
703-remove-GMC-references
Sep 14, 2022
Merged

QuintinWillison merged 10 commits into
integration/version-2from
703-remove-GMC-references

Conversation

@martin-morek

Copy link
Copy Markdown
Contributor
  • fixes #703
  • By default FCM token type will be used, deprecated GCM type is kept only for cases when it's loaded from storage

@uxduck

uxduck commented Oct 22, 2021

Copy link
Copy Markdown
Contributor

This is a breaking change and when users update, they will immediately have to change their code. If we deprecate the original method first, temporarily keep the original for a few releases, and add a new method which users should use instead, users will find the version upgrade process more comfortable.

@martin-morek

Copy link
Copy Markdown
Contributor Author

I believe my changes were done carefully mostly affecting codebase creating a new token witch cannot have GCM type anymore. I've tried to kept possibility to read old token type to don't cause exception but on the other hand simplify a code. @ben-xD if you see any places where it can go wrong please point to them directly so I fix them. However I can definitely add deprecated annotation at the top of old constructor to make it obvious.

@uxduck uxduck left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just a couple of comments, thanks :)

@QuintinWillison QuintinWillison self-assigned this Jan 19, 2022
@QuintinWillison
QuintinWillison removed their request for review January 19, 2022 09:31
- Improves the implementation, moving checks up to the LocalDevice.
- Adds test coverages for constant FCM values we rely upon going forwards.
@QuintinWillison

Copy link
Copy Markdown
Contributor

Emulation failing. 🙄 ... I'm going to have a play in #738 to see if I can get it more stable, before coming back to this PR.

@QuintinWillison
QuintinWillison marked this pull request as draft January 19, 2022 12:25
@QuintinWillison
QuintinWillison changed the base branch from main to tweak-CI-20220119 January 19, 2022 16:26
Base automatically changed from tweak-CI-20220119 to main January 19, 2022 19:09
@QuintinWillison
QuintinWillison marked this pull request as ready for review January 19, 2022 19:11
@QuintinWillison

Copy link
Copy Markdown
Contributor

Emulation run failed:

io.ably.lib.test.android.AndroidPushTest > push_syncOnStartup[test(AVD) - 7.0] FAILED 
	java.lang.AssertionError: expected null, but was:<GotPushDeviceDetails>
	at org.junit.Assert.fail(Assert.java:88)

io.ably.lib.test.android.AndroidPushTest > NotActivated_on_CalledActivate_with_registrationToken[test(AVD) - 7.0] FAILED 
	java.lang.AssertionError: expected collection to have size 1, got 0: [] expected:<1> but was:<0>
	at org.junit.Assert.fail(Assert.java:88)

@QuintinWillison

Copy link
Copy Markdown
Contributor

Emulation run failed:

io.ably.lib.test.android.AndroidPushTest > push_syncOnStartup[test(AVD) - 7.0] FAILED 
	java.lang.AssertionError: expected null, but was:<GotPushDeviceDetails>
	at org.junit.Assert.fail(Assert.java:88)

io.ably.lib.test.android.AndroidPushTest > NotActivated_on_CalledActivate_with_registrationToken[test(AVD) - 7.0] FAILED 
	java.lang.AssertionError: expected collection to have size 1, got 0: [] expected:<1> but was:<0>
	at org.junit.Assert.fail(Assert.java:88)

@QuintinWillison

Copy link
Copy Markdown
Contributor

Given the same test failed twice in a row I think it's back to the drawing board with this PR, alas. 😢

@qsdigor
qsdigor changed the base branch from main to integration/version-2 July 22, 2022 08:45
QSD_igor added 2 commits July 25, 2022 13:43
Remove deprecated test RegistrationTokenTypeTest
Refactor token type usage across LocalDevice as FCM only exist
Refactor generateSecret method for better try
@qsdigor qsdigor assigned qsdigor and unassigned QuintinWillison Jul 25, 2022
@qsdigor qsdigor added the enhancement New feature or improved functionality. label Jul 25, 2022
@qsdigor

qsdigor commented Jul 25, 2022

Copy link
Copy Markdown
Contributor

I have removed all instances and mentions of GCM as it is long past deprecated and removed in 2019.

@KacperKluka KacperKluka left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Almost there 😉

qsdigor and others added 2 commits July 28, 2022 09:20
Co-authored-by: KacperKluka <62378170+KacperKluka@users.noreply.github.com>
@qsdigor
qsdigor requested a review from KacperKluka July 28, 2022 07:30

@KacperKluka KacperKluka left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM 👍

@deanna-seta
deanna-seta marked this pull request as ready for review August 8, 2022 12:56
@QuintinWillison
QuintinWillison merged commit d3cd6dc into integration/version-2 Sep 14, 2022
@QuintinWillison
QuintinWillison deleted the 703-remove-GMC-references branch September 14, 2022 13:57
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.

Remove references to GCM and simplify code

5 participants