Skip to content

Fix uploadFile type to return Promise<string>#56

Merged
mdroidian merged 3 commits intomainfrom
codex/identify-uploadfile-promise-handling
Jan 17, 2026
Merged

Fix uploadFile type to return Promise<string>#56
mdroidian merged 3 commits intomainfrom
codex/identify-uploadfile-promise-handling

Conversation

@mdroidian
Copy link
Copy Markdown
Collaborator

@mdroidian mdroidian commented Jan 17, 2026

Motivation

  • The roamAlphaAPI.util.uploadFile helper is asynchronous and should reflect that in the type definitions.
  • Having the return type as string causes mismatches with implementations that return a promise and can lead to type errors.
  • Aligning the type with actual behavior improves developer ergonomics and prevents incorrect assumptions about sync behavior.

Description

  • Updated the signature in src/types/index.ts for roamAlphaAPI.util.uploadFile from (args: { file: File }) => string to (args: { file: File }) => Promise<string>.
  • Only the type declaration in src/types/index.ts was modified.
  • Changes were staged and committed with the message Fix uploadFile type to return promise.

Testing

  • No automated tests were executed as part of this change.
  • Type-only change; no runtime behavior was modified.

Codex Task

Summary by CodeRabbit

  • Breaking Changes

    • File upload now returns asynchronously — callers must await or handle the Promise; integrations may require updates.
  • Chores

    • Package version bumped (release increment).

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jan 17, 2026

Walkthrough

A type declaration in src/types/index.ts is changed: Window.roamAlphaAPI.util.uploadFile now returns Promise instead of string, altering the public API signature for that function. package.json version is bumped from 0.86.4 to 0.86.5.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Fix uploadFile type to return Promise<string>' directly and accurately describes the main change: updating the type signature of uploadFile from returning string to Promise.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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.

@mdroidian mdroidian merged commit 142e163 into main Jan 17, 2026
2 checks passed
@mdroidian mdroidian deleted the codex/identify-uploadfile-promise-handling branch January 17, 2026 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant