Skip to content

fix: katex breaking the app#6710

Merged
OtavioStasiak merged 6 commits into
developfrom
fix.katex-breaking-the-app
Oct 9, 2025
Merged

fix: katex breaking the app#6710
OtavioStasiak merged 6 commits into
developfrom
fix.katex-breaking-the-app

Conversation

@OtavioStasiak

@OtavioStasiak OtavioStasiak commented Oct 8, 2025

Copy link
Copy Markdown
Contributor

Proposed changes

Issue(s)

https://rocketchat.atlassian.net/browse/SUP-878

How to test or reproduce

  • Open the app;
  • Go to the room with the KaTeX message below;
\[ \color{black} \colorbox{white}{ \boxed{ \begin{matrix} \;\;\;\; \overlinesegment {\underlinesegment{ \Huge Test\; Test \; in \; Test} } & \\ \;\;\textit{develop}\end{matrix} } }\]

Screenshots

Inline KaTeX KaTeX
Simulator Screenshot - iPhone 16 - 2025-10-08 at 18 06 58 Simulator Screenshot - iPhone 16 - 2025-10-08 at 18 07 07

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves a current function)
  • New feature (non-breaking change which adds functionality)
  • Documentation update (if none of the other choices apply)

Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if applicable)
  • I have added necessary documentation (if applicable)
  • Any dependent changes have been merged and published in downstream modules

Further comments

Summary by CodeRabbit

  • New Features

    • Added KaTeX message examples (including inline and large-font variants) to the component stories so reviewers and designers can preview LaTeX-rendered messages in Storybook.
  • Chores

    • Switched the LaTeX rendering dependency to a maintained Git-sourced release to improve install reliability and alignment with upstream fixes; no runtime UI changes expected.

@OtavioStasiak OtavioStasiak marked this pull request as ready for review October 8, 2025 20:25
@coderabbitai

coderabbitai Bot commented Oct 8, 2025

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@OtavioStasiak has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 10 minutes and 15 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 6a61ce0 and 15fd6cd.

⛔ Files ignored due to path filters (2)
  • app/containers/message/__snapshots__/Message.test.tsx.snap is excluded by !**/*.snap
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (2)
  • jest.setup.js (1 hunks)
  • package.json (1 hunks)

Walkthrough

Added a Git-based source for the react-native-katex dependency in package.json and introduced four KaTeX-related story exports in app/containers/message/Message.stories.tsx for Message and MessageLargeFont renderings.

Changes

Cohort / File(s) Summary
Dependency source update
package.json
Updated react-native-katex dependency from "0.5.1" to "git+https://github.com/OtavioStasiak/react-native-katex.git".
KaTeX storybook additions
app/containers/message/Message.stories.tsx
Added local KaTeX message fixtures (katex, inlineKatex) and four exported story components: Katex, KatexLargeFont, InlineKatex, InlineKatexLargeFont to render Message and MessageLargeFont with KaTeX data.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • diegolmello

Poem

I nibbled code crumbs by lantern light,
Swapped a tag for a Git tonight.
Stories now render KaTeX delight,
Fonts both large and tidy, bright.
Hop—no crash—I'll chew and write. 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Linked Issues Check ⚠️ Warning The linked issue SUP-878 requires identifying and fixing the root cause of an iOS crash when rendering KaTeX messages and ensuring the app can open rooms containing KaTeX content, but this PR only updates the dependency source and adds Storybook stories without any changes to runtime message rendering or crash prevention logic. There is no code addressing the crash scenario or using the supplied test case to validate a fix. Implement the necessary changes in the message rendering code to handle KaTeX safely on iOS and include tests or a validation scenario based on the provided reproducible example before marking the linked issue as resolved.
Out of Scope Changes Check ⚠️ Warning The addition of several Storybook story exports for KaTeX examples is unrelated to the stated objective of fixing an iOS crash in production message rendering and constitutes a feature enhancement rather than a bugfix. These changes fall outside the scope of addressing SUP-878’s crash issue. Remove or relocate the Storybook story additions to a separate feature or documentation PR, and focus this PR solely on the minimal code changes required to fix the KaTeX-induced crash.
✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
Title Check ✅ Passed The title clearly indicates that this pull request addresses a bug where KaTeX content was causing the app to break, which aligns with the main change of updating the KaTeX dependency to resolve crashes and adding relevant story tests.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Comment thread package.json Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between d9a60eb and f0934ee.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (1)
  • package.json (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: ESLint and Test / run-eslint-and-test
  • GitHub Check: format

Comment thread package.json Outdated
@OtavioStasiak OtavioStasiak changed the title fix: KateX breaking the app fix: katex breaking the app Oct 8, 2025
@OtavioStasiak OtavioStasiak merged commit c43829c into develop Oct 9, 2025
20 of 26 checks passed
@OtavioStasiak OtavioStasiak deleted the fix.katex-breaking-the-app branch October 9, 2025 16:08
OtavioStasiak added a commit that referenced this pull request Oct 21, 2025
* fix: katex breaking the app

* feat: katex storybook

* fix: unit test

* chore: changed fork link

* fix: yarn.lock
@coderabbitai coderabbitai Bot mentioned this pull request Feb 4, 2026
10 tasks
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.

2 participants