-
Notifications
You must be signed in to change notification settings - Fork 803
Add questions url prop to Bloom player #13384
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
Add questions url prop to Bloom player #13384
Conversation
WalkthroughThe changes update the Bloom player HTML to reference a new JavaScript build and modify the BloomRunner logic to load and pass a new Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant BloomRunner
participant ZipFile
participant BloomPlayerIframe
User->>BloomRunner: Initiate Bloom content loading
BloomRunner->>ZipFile: Extract content, dist, meta, and questions.json
ZipFile-->>BloomRunner: Return URLs for each resource
BloomRunner->>BloomPlayerIframe: Construct iframe src with resource URLs as query params (including questionsJsonUrl)
BloomPlayerIframe-->>User: Render Bloom content with questions
Assessment against linked issues
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
kolibri/core/content/static/bloom/bloomPlayer-02a77592459cdf0b1bd7.min.js
is excluded by!**/*.min.js
📒 Files selected for processing (2)
kolibri/core/content/static/bloom/bloomplayer.htm
(1 hunks)packages/hashi/src/Bloom/BloomRunner.js
(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Frontend tests
- GitHub Check: All file linting
- GitHub Check: Build WHL file / Build WHL
🔇 Additional comments (2)
kolibri/core/content/static/bloom/bloomplayer.htm (1)
11-11
: Appropriate update to use the newer Bloom player bundle.The JavaScript bundle reference has been updated to a new version that supports the
questionsJsonUrl
parameter, which is essential for the fix described in the PR objectives.packages/hashi/src/Bloom/BloomRunner.js (1)
168-170
: Good implementation for loading the questions.json file.The implementation correctly fetches the
questions.json
file from the ZIP archive and safely handles the case where it might not exist using the optional chaining operator.
Build Artifacts
|
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.
All code changes here and in the associated PR on our bloom player fork make sense to me. Just need manual QA to verify the fix.
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.
Thanks @AlexVelezLl - I confirm that the questions.json
error is not appearing anymore and I didn't observe any regressions caused by the fix.
Thanks @pcenov! |
Summary
The security error shown in #13339 was being raised because the bloom player was referencing missing files in a blob url. The first one is because the bloom player was trying to fetch a
questions.json
file just concatenating the file name to theurl
of the htm file, which is incorrect, since we haven't even built a blob url for this file. In Chrome it raises a 404 error, but in Firefox this raises this Security Error. The second security error shown in #13339 was because the bloom file was referencing aBasic Book.css
file, but it was missing in the zip file, so there isn't much we can do there.So this PR:
questions.json
blob url through search param to the bloom playerReferences
Closes #13339.
Reviewer guidance
Replicate #13339
Summary by CodeRabbit
New Features
Chores