Repository navigation
refactor (gql-server): Convert pres_annotation_history_curr.annotationInfo to type Jsonb instead of String - #21578
Conversation
WalkthroughThe pull request introduces significant modifications to the In the SQL schema, several new functions, tables, and views have been added to enhance the management of meetings and users. Key additions include the creation of a new Possibly related PRs
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Outside diff range and nitpick comments (1)
bbb-graphql-server/bbb_schema.sql (1)
1381-1381: LGTM! The type change improves data integrity and query performance.The change from TEXT to JSONB type for
annotationInfois a good improvement as it:
- Ensures JSON validity at the database level
- Enables native JSON operations and indexing
- Provides better performance for JSON data storage and retrieval
Consider adding a GIN index if you need to query inside the JSON content:
CREATE INDEX idx_annotation_history_info ON pres_annotation_history USING gin (annotationInfo);
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
akka-bbb-apps/src/main/scala/org/bigbluebutton/core/db/PresAnnotationHistoryDAO.scala(4 hunks)bbb-graphql-server/bbb_schema.sql(1 hunks)
🔇 Additional comments (3)
akka-bbb-apps/src/main/scala/org/bigbluebutton/core/db/PresAnnotationHistoryDAO.scala (2)
5-5: LGTM: Required import for JSON handling
The addition of spray.json.JsValue import is appropriate for the type conversion.
51-51: LGTM: Proper handling of deleted annotations
Setting annotationInfo to None for deleted annotations is the correct approach and aligns with the PR objectives.
bbb-graphql-server/bbb_schema.sql (1)
1381-1381: Verify the data migration plan.
Ensure there's a migration plan to convert existing TEXT data to JSONB format. Invalid JSON data in existing rows could cause migration failures.
Run this script to check for invalid JSON in existing data:
Automated tests Summary✅ All the CI tests have passed! |



This PR updates the
annotationInfofield tojsonb, removing the need to check if it’s a JSON or a string. For removed annotations, the value will benull. This change, as confirmed by @KDSBrowne, will simplify client code.Related: #21509
Supports: #21571
Example:
{ "data": { "pres_annotation_history_curr": [ { "annotationId": "shape:yqoGH5E81xtAgcUU1qX8s", "annotationInfo": { "x": 946.1111111111111, "y": 323.00347222222223, "id": "shape:yqoGH5E81xtAgcUU1qX8s", "meta": { "createdBy": "w_evuaiobx1vx8", "updatedBy": "w_evuaiobx1vx8" }, "type": "draw", "index": "a1", "props": { "dash": "draw", "fill": "none", "size": "m", "color": "black", "isPen": false, "isClosed": false, "segments": [ { "type": "free", "points": [ { "x": 0, "y": 0, "z": 0.5 }, { "x": 0, "y": 0.56, "z": 0.5 }, { "x": -28.89, "y": 268.89, "z": 0.5 }, { "x": -27.78, "y": 267.78, "z": 0.5 } ] } ], "isComplete": true }, "opacity": 1, "isLocked": false, "parentId": "page:1", "rotation": 0, "typeName": "shape", "isModerator": true }, "meetingId": "d1536302cffb5587becb2d018a891e6cf1108d9e-1730320326926", "pageId": "aa68eade1e0508159eb86fdf638dab1b5d90d5d4-1730320326928/1", "presentationId": "aa68eade1e0508159eb86fdf638dab1b5d90d5d4-1730320326928", "updatedAt": "2024-10-30T20:32:15.491+00:00", "userId": "w_evuaiobx1vx8", "userIsModerator": true }, { "annotationId": "shape:oPzZyOgJnap9xbUMQ13Sz", "annotationInfo": { "x": 1102.7777777777778, "y": 317.4479166666667, "id": "shape:oPzZyOgJnap9xbUMQ13Sz", "meta": { "createdBy": "w_evuaiobx1vx8", "updatedBy": "w_evuaiobx1vx8" }, "type": "draw", "index": "a2", "props": { "dash": "draw", "fill": "none", "size": "m", "color": "black", "isPen": false, "isClosed": false, "segments": [ { "type": "free", "points": [ { "x": 0, "y": 0, "z": 0.5 }, { "x": -229.44, "y": 321.67, "z": 0.5 }, { "x": -231.67, "y": 321.67, "z": 0.5 }, { "x": -232.78, "y": 321.67, "z": 0.5 }, { "x": -235, "y": 319.44, "z": 0.5 } ] } ], "isComplete": true }, "opacity": 1, "isLocked": false, "parentId": "page:1", "rotation": 0, "typeName": "shape", "isModerator": true }, "meetingId": "d1536302cffb5587becb2d018a891e6cf1108d9e-1730320326926", "pageId": "aa68eade1e0508159eb86fdf638dab1b5d90d5d4-1730320326928/1", "presentationId": "aa68eade1e0508159eb86fdf638dab1b5d90d5d4-1730320326928", "updatedAt": "2024-10-30T20:32:15.921+00:00", "userId": "w_evuaiobx1vx8", "userIsModerator": true }, { "annotationId": "shape:2lb8rHrNIOUqclLMKhzDB", "annotationInfo": { "x": 1196.111111111111, "y": 410.78125, "id": "shape:2lb8rHrNIOUqclLMKhzDB", "meta": { "createdBy": "w_evuaiobx1vx8", "updatedBy": "w_evuaiobx1vx8" }, "type": "draw", "index": "a3", "props": { "dash": "draw", "fill": "none", "size": "m", "color": "black", "isPen": false, "isClosed": false, "segments": [ { "type": "free", "points": [ { "x": 0, "y": 0, "z": 0.5 }, { "x": -280.56, "y": 267.78, "z": 0.5 } ] } ], "isComplete": true }, "opacity": 1, "isLocked": false, "parentId": "page:1", "rotation": 0, "typeName": "shape", "isModerator": true }, "meetingId": "d1536302cffb5587becb2d018a891e6cf1108d9e-1730320326926", "pageId": "aa68eade1e0508159eb86fdf638dab1b5d90d5d4-1730320326928/1", "presentationId": "aa68eade1e0508159eb86fdf638dab1b5d90d5d4-1730320326928", "updatedAt": "2024-10-30T20:32:16.321+00:00", "userId": "w_evuaiobx1vx8", "userIsModerator": true }, { "annotationId": "shape:yqoGH5E81xtAgcUU1qX8s", "annotationInfo": null, "meetingId": "d1536302cffb5587becb2d018a891e6cf1108d9e-1730320326926", "pageId": "aa68eade1e0508159eb86fdf638dab1b5d90d5d4-1730320326928/1", "presentationId": "aa68eade1e0508159eb86fdf638dab1b5d90d5d4-1730320326928", "updatedAt": "2024-10-30T20:32:30.335+00:00", "userId": "w_evuaiobx1vx8", "userIsModerator": true } ] } }