Skip to content
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

feat: Add set & get deviceInfo & datatype #250

Merged
merged 6 commits into from
Sep 7, 2023
Merged

Conversation

gmaclennan
Copy link
Member

This fixes initial implementation #249. It adds an internal datatype for deviceInfo on the project instance, so that it can be used by the $member namespace for reading and writing member info. This part has no tests yet because it's best to test the $member methods once they are available.

This also adds client.setDeviceInfo() and client.getDeviceInfo() methods, along with a new table in the client db for storing this info.

I wasn't too sure about how to store this in SQLite. We will only ever have one deviceInfo record, so options are:

  1. Store a single row with either:
    i. A column for each property
    ii A single JSON column with all info
  2. Write a row for each property of deviceInfo, like how mbtiles metadata is stored.

I went with (2), but having done it I think (1) with a JSON column might be the better / simpler option.

@gmaclennan gmaclennan linked an issue Sep 6, 2023 that may be closed by this pull request
6 tasks
@gmaclennan gmaclennan self-assigned this Sep 6, 2023
@gmaclennan gmaclennan requested a review from achou11 September 6, 2023 13:01
@achou11
Copy link
Member

achou11 commented Sep 6, 2023

I went with (2), but having done it I think (1) with a JSON column might be the better / simpler option.

yeah I think (1) is easier to work with. if we don't need querying then the JSON sounds good to me.

Copy link
Member

@achou11 achou11 left a comment

Choose a reason for hiding this comment

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

methods implementations look good. can re-review once the sqlite changes are finalized

* main:
  expose member namespace in MapeoProject (#253)
  blobStore.createReadStream should not wait (#243)
  update MapeoManager to return and handle project public IDs (#247)
  return content hash from blobApi.create (#242)
@gmaclennan gmaclennan requested a review from achou11 September 7, 2023 10:05
@gmaclennan
Copy link
Member Author

methods implementations look good. can re-review once the sqlite changes are finalized

Ok changes made, it's ready to review again.

Non-mapeo doc tables mustn't have the same name as mapeo doc tables
@gmaclennan gmaclennan merged commit f4d1a24 into main Sep 7, 2023
@gmaclennan gmaclennan mentioned this pull request Sep 7, 2023
3 tasks
@gmaclennan gmaclennan deleted the feat/device-info branch September 7, 2023 13:16
gmaclennan added a commit that referenced this pull request Sep 12, 2023
* main:
  feat: Add set & get deviceInfo & datatype (#250)
  expose member namespace in MapeoProject (#253)
  blobStore.createReadStream should not wait (#243)
  update MapeoManager to return and handle project public IDs (#247)
  return content hash from blobApi.create (#242)
gmaclennan added a commit that referenced this pull request Sep 19, 2023
* main:
  chore: condense setup code in MemberAPI tests (#267)
  chore: replace queries opt in MemberAPI with dataType (#266)
  feat: add getMany method to member api (#263)
  feat: add getById method to member api (#262)
  chore: Update @digidem/types and remove patch (#269)
  feat: share all core keys via extension messages (#264)
  feat: send core "haves" bitfield on first connect (#254)
  fix: invite.encryptionKeys should be required (#260)
  feat: Add set & get deviceInfo & datatype (#250)
  expose member namespace in MapeoProject (#253)
  blobStore.createReadStream should not wait (#243)
  update MapeoManager to return and handle project public IDs (#247)
  return content hash from blobApi.create (#242)
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.

Initial deviceInfo implementation
2 participants