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.
Inject DocsBotAI chat widget loader into all pages via
headin vocs.config.tsx to test XMTP DocsBotThis change adds an inline
<script>to theheadoutput in vocs.config.tsx that defineswindow.DocsBotAI.init, dynamically insertshttps://widget.docsbot.ai/chat.js, waits for the script to load, mounts the widget, uses aMutationObserverto wait for#docsbotai-root, and immediately invokesDocsBotAI.initwith a specific id string. The script is rendered alongside existing head scripts.📍Where to Start
Start with the
headfunction in vocs.config.tsx to review the inline script injection and initialization logic.📊 Macroscope summarized 3759ea7. 1 files reviewed, 5 issues evaluated, 4 issues filtered, 0 comments posted
🗂️ Filtered Issues
vocs.config.tsx — 0 comments posted, 5 evaluated, 4 filtered
search.boostDocumentcallsdocumentId.includes(...)without guarding for non-string inputs. IfdocumentIdisundefined,null, or a non-string, this will throw at runtime and may break search indexing or result boosting. Add a type check or default to an empty string before callingincludes. [ Low confidence ]search.filtercallsresult.id.includes(...)without guarding forresult.idbeingundefined,null, or non-string. This can cause a runtime exception during search result filtering. Add a check (e.g.,typeof result.id === 'string') before usingincludes. Also, mutatingresult.sectionassumes the object is mutable and that the framework reads this property; ifvocsexpects immutability or ignores mutations, this may have no effect or cause subtle issues. [ Invalidated by documentation search ]DocsBotAI.initdoes not guard against multiple invocations across SPA navigations or re-renders ofhead. Each call inserts a new<script src="https://widget.docsbot.ai/chat.js">and triggersmount, potentially leading to duplicate script loads, duplicate widget instances, or re-entrancy errors. Implement an idempotency guard (e.g., check for an existing script by src, or awindow.DocsBotAI.__initializedflag) and ensure at-most-once mounting with a swap-and-clear or state transition. [ Invalidated by documentation search ]DocsBotAI.initlogic waits for a DOM element#docsbotai-rootusing aMutationObserverand a Promise, but does not implement a timeout. If the element never appears (e.g., due to widget failure or markup differences), the Promise will never resolve,DocsBotAI.initwill never fulfill, and theMutationObserverwill continue observing indefinitely, leaking resources. Add a timeout with rejection and ensure the observer disconnects on all exit paths. [ Invalidated by documentation search ]