Skip to content

Commit

Permalink
move noUnusedParameters=true from IDE to compile
Browse files Browse the repository at this point in the history
  • Loading branch information
jkasten2 committed Sep 21, 2024
1 parent aec2837 commit 700f8ec
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build/config/tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"noImplicitReturns": true,
"noImplicitThis": true,
"noUnusedLocals": true,
"noUnusedParameters": false,
"noUnusedParameters": true,
"allowSyntheticDefaultImports": true,
"allowUnreachableCode": false,
"allowUnusedLabels": false,
Expand Down
10 changes: 8 additions & 2 deletions src/shared/managers/SubscriptionManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,9 @@ export class SubscriptionManager {
* @param rawPushSubscription The raw push subscription obtained from calling subscribe(). This
* can be null, in which case OneSignal's device record is set to unsubscribed.
*
* @param subscriptionState Describes whether the device record is subscribed, unsubscribed, or in
* @param subscriptionState TODO: This is no longer used here and needs some refactoring to
* put this back into place.
* Describes whether the device record is subscribed, unsubscribed, or in
* another state. By default, this is set from the availability of rawPushSubscription (exists:
* Subscribed, null: Unsubscribed). Other use cases may result in creation of a device record that
* warrants a special subscription state. For example, a device ID can be retrieved by providing
Expand All @@ -251,7 +253,7 @@ export class SubscriptionManager {
*/
public async registerSubscription(
pushSubscription: RawPushSubscription,
subscriptionState?: SubscriptionStateKind,
_subscriptionState?: SubscriptionStateKind,
): Promise<Subscription> {
/*
This may be called after the RawPushSubscription has been serialized across a postMessage
Expand Down Expand Up @@ -477,6 +479,10 @@ export class SubscriptionManager {
await this.context.serviceWorkerManager.installWorker();
} catch (err) {
if (err instanceof ServiceWorkerRegistrationError) {
// TODO: This doesn't register the subscription any more, most likely broke
// in some refactoring in the v16 major release. It would be useful if a
// subscription was created so the customer knows this failed by seeing
// subscriptions in this state on the OneSignal dashboard.
if (err.status === 403) {
await this.context.subscriptionManager.registerFailedSubscription(
SubscriptionStateKind.ServiceWorkerStatus403,
Expand Down
2 changes: 1 addition & 1 deletion src/shared/utils/Encoding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export function base64Encode(str) {
return btoa(
encodeURIComponent(str).replace(
/%([0-9A-F]{2})/g,
function toSolidBytes(match, p1) {
function toSolidBytes(_match, p1) {
return String.fromCharCode(('0x' as any) + p1);
},
),
Expand Down
1 change: 0 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"strictNullChecks": true,
"checkJs": true,
"noImplicitAny": true,
"noUnusedParameters": true,
"strictPropertyInitialization": true,
"baseUrl": ".",
"types": ["jest", "node"]
Expand Down

0 comments on commit 700f8ec

Please sign in to comment.