-
Notifications
You must be signed in to change notification settings - Fork 3
MC:3249 Confluence App :Resolved bug causing inserted diagrams to fai… #7
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
MC:3249 Confluence App :Resolved bug causing inserted diagrams to fai… #7
Conversation
…l loading on Confluence pages
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
Pull Request Overview
This PR adds client-side image compression and payload size checks to prevent oversized base64 images from failing the Confluence API during macro saves.
- Introduces
compressBase64Image
andcalculateDataSize
utilities with configurable thresholds. - Integrates size checks in the form submission flow to conditionally compress images before saving.
- Updates the macro save call to use compressed image data when payload exceeds limits.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
public/js/imageUtils.js | Added base64 image compression and data size calculation utilities |
public/js/editor/form.js | Imported and applied compression logic with size threshold checks |
Comments suppressed due to low confidence (2)
public/js/editor/form.js:104
- [nitpick] This error handling only logs to the console and uses a less consistent message format. Consider showing a user-facing notification and standardizing the error text.
console.error("The diagram is too large to save, Try simplifying your diagram or reducing its complexity");
public/js/imageUtils.js:1
- There are no unit tests covering
compressBase64Image
orcalculateDataSize
. Adding tests would help ensure compression and size calculations work correctly and prevent regressions.
// Configuration for size limits and compression settings
Resolved an issue where Mermaid diagrams were not rendering properly on Confluence pages due to oversized base64-encoded image data,which caused API failures. The plugin now compresses the base64 image before saving it via the Confluence API, significantly reducing payload size and improving rendering reliability