For #25479
# Checklist for submitter
- [X] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/Committing-Changes.md#changes-files)
for more information.
- [X] Manual QA for all new/changed functionality
## Details
This PR fixes the `privacy_preferences` table results generator for the
Chrome Extension. The root cause was that we were attempting to return
boolean values directly to sqlite, which doesn't have a native boolean
type. The fix is to coerce booleans to "1" or "0" as we do for other
tables in the extension.
The _proximate_ cause of the issue was that the warnings generated at
the db level (in this case about not being able to handle the `null`
values that sqlite was coercing booleans to) are not being handled
correctly. I'll tackle this in a separate PR as it's a little more
complicated to debug and fix.
## Testing
On a Chromebook, was able to run a live `select * from
privacy_preferences` query with results:
<img width="1706" alt="image"
src="https://github.com/user-attachments/assets/7dcc4410-70fd-4381-842d-fd06d43b94ae"
/>
<img width="1708" alt="image"
src="https://github.com/user-attachments/assets/db783e7b-3351-424c-82e3-b7e80c1d999d"
/>
Added automated test that fails on main and passes on this branch.
#18940
# Checklist for submitter
<!-- Note that API documentation changes are now addressed by the
product design team. -->
- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- [ ] Added/updated tests
- [x] Manual QA for all new/changed functionality
#18775
Fixed bug where fleetd-chrome sent multiple read requests to Fleet
server at the same time.
# Checklist for submitter
<!-- Note that API documentation changes are now addressed by the
product design team. -->
- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- [x] Manual QA for all new/changed functionality
Follow-up cleanup for #18210
Merging during freeze with approval from @sharon-fdm and @lukeheath as this code only affects `fleetd-chrome`, which is released on its own schedule.
---------
Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
Reinitialize DB and recover after a rare RuntimeError coming from sqlite
web assembly code.
#18337
# Checklist for submitter
If some of the following don't apply, delete the relevant line.
<!-- Note that API documentation changes are now addressed by the
product design team. -->
- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- [ ] Added/updated tests
- [x] Manual QA for all new/changed functionality
This is a speculative fix for #16394 RuntimeError, which was coming from
wa-sqlite web assembly code.
# Checklist for submitter
If some of the following don't apply, delete the relevant line.
<!-- Note that API documentation changes are now addressed by the
product design team. -->
- [x] Changes file added for user-visible changes in `changes/` or
`orbit/changes/`.
- [x] Manual QA for all new/changed functionality
Fixed unreleased fleetd-chrome bug with sticky errors showing up after
querying privacy_preferences table.
#16292
# Checklist for submitter
If some of the following don't apply, delete the relevant line.
<!-- Note that API documentation changes are now addressed by the
product design team. -->
- [x] Changes file added for user-visible changes in `changes/` or
`orbit/changes/`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- [x] Added/updated tests
- [x] Manual QA for all new/changed functionality
Add GitHub Actions for releasing fleetd-chrome beta and production. See
the included README updates for details.
This was tested with an `on: pull-request` trigger for the beta workflow
which is now removed for merging into the repo.
This fixes fleetd-chrome extension -- it now works when loaded in
development mode in Chrome.
The problem was that fleetd-chrome extension is setting status=1 when
query has warnings. Fleet server drops any detail query results with
status=1. So, the fleetd-chrome host was never getting fully initialized
on the server.
- [X] Manual QA for all new/changed functionality
## Addresses #11037
### Implement the `privacy_preferences` table for the Fleetd Chrome
extension. Columns correspond to the available properties of
[`chrome.privacy`](https://developer.chrome.com/docs/extensions/reference/privacy/).
Chrome on mac:
<img width="816" alt="Screenshot 2023-06-23 at 11 55 21 AM"
src="https://github.com/fleetdm/fleet/assets/61553566/a4700749-6325-442e-acf2-c14b1c9adf8f">
Chromebook with enterprise access (actual use case):

* Chromebook w/o enterprise access: as you can see, sometimes certain
APIs are not available - this error occurs because the expected API
object that would have a `get` method is actually `undefined` TODO – How
to handle this case given that we want to let errors bubble up to the
level at which Fleet can catch them? Maybe it would be nice to catch
such errors and send them up to the Fleet layer, and still allow the
loop to continue to populate the columns whose APIs _are_ available.
_Decision: catch API errors here to preserve functionality of the
remaining columns_

- [x] Changes file
- [x] Manual QA
---------
Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
# Checklist for submitter
If some of the following don't apply, delete the relevant line.
- [x] Changes file added for user-visible changes in `changes/` or
`orbit/changes/`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- [x] Added/updated tests
- [x] Manual QA for all new/changed functionality