-
Notifications
You must be signed in to change notification settings - Fork 31
Support Profile Live Status, Data Layer #1049
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
Open
joelmuraguri
wants to merge
9
commits into
main
Choose a base branch
from
joel/profile-status-data-layer
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+313
−2
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
a6a02cb
add ProfileStatus model and polymorphic writable
joelmuraguri 53416e7
add ProfileStatusEntity
joelmuraguri 2aa51a1
add ProfileStatusEntity db queries
joelmuraguri 5897f9d
add ProfileStatus string
joelmuraguri a188e99
add ProfileStatusUpdate logic in WriteQueue
joelmuraguri 29aaf99
implement updateProfileStatus logic
joelmuraguri be2c37d
handle ProfileStatus conversions
joelmuraguri 22a3e44
exhaust writable when block
joelmuraguri ec5b4bd
include ProfileStatusEntity in app database
joelmuraguri File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ | |
| "formatVersion": 1, | ||
| "database": { | ||
| "version": 34, | ||
| "identityHash": "1e975be4633a2c929f918f6201d3bdf4", | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the DB identity hash changes, it means you're missing a migration. The identity has hash for a DB version shouldn't change. |
||
| "identityHash": "adbac83d33dc50b8cc208c46f3e14c77", | ||
| "entities": [ | ||
| { | ||
| "tableName": "bookmarks", | ||
|
|
@@ -1041,6 +1041,78 @@ | |
| } | ||
| ] | ||
| }, | ||
| { | ||
| "tableName": "profile_statuses", | ||
| "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` TEXT NOT NULL, `statusValue` TEXT NOT NULL, `embedUri` TEXT, `embedTitle` TEXT, `embedDescription` TEXT, `embedThumb` TEXT, `expiresAt` INTEGER, `isActive` INTEGER, `isDisabled` INTEGER, PRIMARY KEY(`profileId`), FOREIGN KEY(`profileId`) REFERENCES `profiles`(`did`) ON UPDATE NO ACTION ON DELETE CASCADE )", | ||
| "fields": [ | ||
| { | ||
| "fieldPath": "profileId", | ||
| "columnName": "profileId", | ||
| "affinity": "TEXT", | ||
| "notNull": true | ||
| }, | ||
| { | ||
| "fieldPath": "statusValue", | ||
| "columnName": "statusValue", | ||
| "affinity": "TEXT", | ||
| "notNull": true | ||
| }, | ||
| { | ||
| "fieldPath": "embedUri", | ||
| "columnName": "embedUri", | ||
| "affinity": "TEXT" | ||
| }, | ||
| { | ||
| "fieldPath": "embedTitle", | ||
| "columnName": "embedTitle", | ||
| "affinity": "TEXT" | ||
| }, | ||
| { | ||
| "fieldPath": "embedDescription", | ||
| "columnName": "embedDescription", | ||
| "affinity": "TEXT" | ||
| }, | ||
| { | ||
| "fieldPath": "embedThumb", | ||
| "columnName": "embedThumb", | ||
| "affinity": "TEXT" | ||
| }, | ||
| { | ||
| "fieldPath": "expiresAt", | ||
| "columnName": "expiresAt", | ||
| "affinity": "INTEGER" | ||
| }, | ||
| { | ||
| "fieldPath": "isActive", | ||
| "columnName": "isActive", | ||
| "affinity": "INTEGER" | ||
| }, | ||
| { | ||
| "fieldPath": "isDisabled", | ||
| "columnName": "isDisabled", | ||
| "affinity": "INTEGER" | ||
| } | ||
| ], | ||
| "primaryKey": { | ||
| "autoGenerate": false, | ||
| "columnNames": [ | ||
| "profileId" | ||
| ] | ||
| }, | ||
| "foreignKeys": [ | ||
| { | ||
| "table": "profiles", | ||
| "onDelete": "CASCADE", | ||
| "onUpdate": "NO ACTION", | ||
| "columns": [ | ||
| "profileId" | ||
| ], | ||
| "referencedColumns": [ | ||
| "did" | ||
| ] | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "tableName": "postLikes", | ||
| "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`postUri` TEXT NOT NULL, `authorId` TEXT NOT NULL, `createdAt` INTEGER NOT NULL, `indexedAt` INTEGER NOT NULL, PRIMARY KEY(`postUri`, `authorId`), FOREIGN KEY(`postUri`) REFERENCES `posts`(`uri`) ON UPDATE CASCADE ON DELETE CASCADE , FOREIGN KEY(`authorId`) REFERENCES `profiles`(`did`) ON UPDATE CASCADE ON DELETE CASCADE )", | ||
|
|
@@ -3209,7 +3281,7 @@ | |
| ], | ||
| "setupQueries": [ | ||
| "CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)", | ||
| "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '1e975be4633a2c929f918f6201d3bdf4')" | ||
| "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, 'adbac83d33dc50b8cc208c46f3e14c77')" | ||
| ] | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
titleanddescriptionfor the live status are hardcoded as empty strings. This is also repeated in thetoOutcomeblock on lines 567-568.This is a missed opportunity to provide more context about the live stream. Consider enhancing the
Profile.StatusUpdate.GoLivemodel to accept an optional title and description. If they aren't provided, you could attempt to fetch this metadata from thestreamUrl(e.g., by parsing OpenGraph tags from the HTML at the URL). This would make the feature more robust and provide a better user experience.