getRecords

abstract fun getRecords(syncIfEmpty: Boolean = false): List<RemoteSettingsRecord>?

Get the current set of records.

This method normally fetches records from the last sync. This means that it returns fast and does not make any network requests.

If records have not yet been synced it will return None. Use sync_if_empty = true to change this behavior and perform a network request in this case. That this is probably a bad idea if you want to fetch the setting in application startup or when building the UI.

None will also be returned on disk IO errors or other unexpected errors. The reason for this is that there is not much an application can do in this situation other than fall back to the same default handling as if records have not been synced.

TODO(Bug 1919141):

Application-services schedules regular dumps of the server data for specific collections. For these collections, get_records will never return None. If you would like to add your collection to this list, please reach out to the DISCO team.