Skip to content

Conversation

@marcosholgado
Copy link
Contributor

Task/Issue URL: https://app.asana.com/0/414730916066338/1200407932131592
Tech Design URL:
CC:

Description:
This PR wraps the getInstance() call from the Service Worker to avoid crashing the app.

Steps to test this PR:

  1. Build the app and make sure it doesn't crash!

Internal references:

Software Engineering Expectations
Technical Design Template

Comment on lines +39 to +45
try {
ServiceWorkerController.getInstance().setServiceWorkerClient(
BrowserServiceWorkerClient(requestInterceptor, uncaughtExceptionRepository)
)
} catch (e: Exception) {
Timber.w(e.localizedMessage)
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: I quite like using runCatching instead of try-catch blocks

Copy link
Collaborator

@aitorvs aitorvs left a comment

Choose a reason for hiding this comment

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

LGTM

@aitorvs aitorvs self-assigned this Jun 7, 2021
@marcosholgado marcosholgado merged commit 34e191e into develop Jun 7, 2021
@marcosholgado marcosholgado deleted the feature/marcos/fix_worker_service_crash branch June 7, 2021 10:57
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