Open Bug 1796416 Opened 2 years ago Updated 1 year ago

Re-consider `close` method on the RustPlacesConnection

Categories

(Fenix :: History, task)

All
Android
task

Tracking

(Not tracked)

People

(Reporter: cpeterson, Unassigned)

Details

From github: https://github.com/mozilla-mobile/android-components/issues/7348.

In its current form, it's broken:

  • if we ever close (and null-out the api reference), there's currently no way to re-open the connection

This caused a problem on the sample browser, which called the close method in its activity's onDestroy, and we'd end up crashing on next access to the storage layer.

We haven't seen this happen in Fenix or r-b because they don't ever end up calling the cleanup/close methods.

It's not clear to me that we ever do need to clean up these connections; if the process isn't around at all, we're good - OS will clean up after us. If we have some background worker running and accessing storage (e.g. sync), we certainly shouldn't try to close the connection as part of the activity lifecycle.

The semantics of "once initialized, keep the connection(s) around for the duration of the process's lifecycle" seems just fine here. If that's the case, we should remove the close and cleanup methods from the API surface.

cc @thomcc

┆Issue is synchronized with this Jira Task

Change performed by the Move to Bugzilla add-on.

The severity field is not set for this bug.
:cpeterson, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(cpeterson)
Severity: -- → N/A
Type: defect → task
Flags: needinfo?(cpeterson)
You need to log in before you can comment on or make changes to this bug.