-
Notifications
You must be signed in to change notification settings - Fork 116
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
Remove subdomain code (os.tc) #1142
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jkasten2
force-pushed
the
refactor/rm_ostc_code
branch
2 times, most recently
from
November 23, 2023 05:23
338036a
to
39ed293
Compare
jkasten2
changed the title
[WIP] [Refactor] Remove subdomain code
[WIP] Remove subdomain code (os.tc)
Nov 27, 2023
IsUsingSubscriptionWorkaround is going to be removed in future commits so moved this into a more permanent place, in the app config logic.
Removed the internalIsUsingSubscriptionWorkaround function and all code dependent on it.
Removed isUsingSubscriptionWorkaround() and all usages of it
Remove SdkEnvironment.getIntegration() as the SDK only supports IntegrationKind.Secure now. If the developer attempted to init the SDK in a non-secure env then we would have thrown before this.
Remove AltOriginManager as it was only used to manage proxy iframes to os.tc.
Remove canTalkToServiceWorker() as we already check HTTPS on init.
Remove DeprecatedApiError, this could have been removed with the v16 release since these APIs were droped then
Removed all the unsupported HTTP subdmain (os.tc) types from WindowEnvironmentKind and code using them.
Remove all notification permission logic for HTTP / subdomain detection
This is no longer need and corrected related http checks to use window.isSecureContext instead. (as localhost is a secure context)
This is always HTTPS now as HTTP is no longer supported.
OneSignal must be included on the intented page and we no longer support the os.tc / onesginal.com subdomain option.
Made this change to make this more clear that this is an unsupported setting. Cleaned up some usages of subdomain as well.
This was related to subdomain which was removed in the previous commit
useSafariLegacyPush is already checked in getSubscriptionStateForSecure
This was used to talk between the removed os.tc iframe and the main page
OneSignal SDK can't be run in an iframe so this detection can be removed now.
It isn't clear why this started failing recently, but tests no longer fail after this change.
jkasten2
force-pushed
the
refactor/rm_ostc_code
branch
from
November 28, 2023 21:19
0f7a5ad
to
d869a8e
Compare
jkasten2
changed the title
[WIP] Remove subdomain code (os.tc)
Remove subdomain code (os.tc)
Dec 6, 2023
rgomezp
approved these changes
Dec 11, 2023
Other than what we discussed, LGTM. One nit is the tests are logging an error (tests still pass) -- this may or may not be something that predates these changes
|
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
1 Line Summary
Remove code for the OneSignal Subdomain label (os.tc) as supported was dropped in v16.
Details
Motivation
Motivation to removing this deadcode is to make upcoming changes easier to make. This PR also results in a noticeable size reduction in the SDK.
Scope
This PR addresses deleting anything related to the dropped subdomain / os.tc feature. Very minor refactoring was done to clean up some code paths related to the feature removal.
Validation
Test on Windows 11 23H2 with Chrome 119.
Tested on macOS 13.6.1 Safari 17.1
Tested on iOS 16.7.2
Tests
Info
Checklist
Programming Checklist
Interfaces:
Functions:
Typescript:
Other:
elem of array
syntax. PreferforEach
or usemap
context
if possible. Instead, we can pass it to function/constructor so that we don't callOneSignal.context
Screenshots
Info
Checklist
Related Tickets
This change is