-
Notifications
You must be signed in to change notification settings - Fork 268
Add per-channel flags; support "no store" channels #1052
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
Add a "no store" flag for channels
|
@liamcottle would you like me to add Update: the commands are now implemented and were tested using meshcore_py. |
|
Also, you really need to get buy-in from Liam, to support modifying the CMD_GET_CHANNEL and CMD_SET_CHANNEL companion protocol |
|
@ripplebiz thank you for the code review! Updated with your feedback.
I think it makes sense to add new commands for getting and setting the flags for a given channel at a time. I'll work on that next! |
|
@ripplebiz I've added new CMD_GET_CHANNEL_FLAG_NOSTORE and CMD_SET_CHANNEL_FLAG_NOSTORE commands here, so there is no impact to the existing companion protocol. I've also published a PR that adds these to the Python API: meshcore-dev/meshcore_py#31 Would you mind taking another look? |
|
Just a little thought, maybe no_store channels could be handled only by the application ? (as there is no need to store message when connected to the app) I've been thinking that an alternative way to get the same result as proposed here would be to register no_store channels only in the app and read them from rx_log Then to send on these channels, there would be a new command to send a msg providing the pubkey of the channel where to send the message to And channels configured on the device would be dedicated to "store" channels (and we can lower their number, which would be another benefit), there would then be an unlimited number of no_store channels |
In the PugetMesh community we have channels like #bot and #testing that are mostly used for "can you hear me?" tests. These are the most heavily-used channels in the region, yet the messages are not useful to store offline - they take up space on the device and are time-consuming to sync when reconnecting a phone to the companion.
This PR introduces a per-channel "no store" flag that tells the companion not to store any messages for the channel unless a phone is connected. This reserves more offline storage for channels that actually matter, and makes reconnecting faster.
This PR also introduces the concept of channel flags. These are persisted in the unused 4-byte header of each channel in the data store. Other per-channel settings such as notifications enabled/disabled can be stored here in the future.
Testing performed on a WisMesh Tag:
Upgrade
noStore=false.Behavior when noStore = false
Behavior when noStore = true
Settings persistence
CMD_GET_CHANNEL_FLAG_NOSTOREreturns the noStore valueCMD_SET_CHANNEL_FLAG_NOSTOREcorrectly sets the noStore valueAPI support