Skip to content

Conversation

@doc-han
Copy link
Contributor

@doc-han doc-han commented Dec 5, 2025

Description

This PR resolves an issue where the docs panel was unable to retrieve information for some adaptors. mainly the latest versions of the adaptors
Closes #4136

Validation steps

  1. Go to the Job Editor IDE
  2. switch your adaptor version to latest
  3. Does the docs panel show the documentation for the version supposed to be latest? if so then we're good. else we're not.

Additional notes for the reviewer

  1. (Is there anything else the reviewer should know or look out for?)

AI Usage

Please disclose how you've used AI in this work (it's cool, we just want to know!):

  • Code generation (copilot but not intellisense)
  • Learning or fact checking
  • Strategy / design
  • Optimisation / refactoring
  • Translation / spellchecking / doc gen
  • Other
  • I have not used AI

You can read more details in our Responsible AI Policy

Pre-submission checklist

  • I have performed a self-review of my code.
  • I have implemented and tested all related authorization policies. (e.g., :owner, :admin, :editor, :viewer)
  • I have updated the changelog.
  • I have ticked a box in "AI usage" in this PR

@doc-han doc-han linked an issue Dec 5, 2025 that may be closed by this pull request
@github-project-automation github-project-automation bot moved this to New Issues in v2 Dec 5, 2025
@codecov
Copy link

codecov bot commented Dec 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.03%. Comparing base (eb067ad) to head (3a35770).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4141      +/-   ##
==========================================
+ Coverage   89.02%   89.03%   +0.01%     
==========================================
  Files         425      425              
  Lines       19611    19611              
==========================================
+ Hits        17459    17461       +2     
+ Misses       2152     2150       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@doc-han doc-han requested review from elias-ba, stuartc, taylordowns2000 and theroinaochieng and removed request for elias-ba December 5, 2025 14:15
Copy link
Contributor

@elias-ba elias-ba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @doc-han for some reasons I still see the error happening.

Image

@github-project-automation github-project-automation bot moved this from New Issues to In review in v2 Dec 5, 2025
@elias-ba
Copy link
Contributor

elias-ba commented Dec 5, 2025

Oh @doc-han I see the issue! This is not your fault at all. Actually what happened was the projectAdaptors list only gets populated from the database - it queries saved jobs to find which adaptors are used in the project. But when you add a new adaptor (like Gmail) to a job and haven't saved yet, that adaptor only exists in the Y.Doc (collaborative state), not in the database. So when your code tried to resolve @openfn/language-gmail@latest to an actual version, it searched projectAdaptors, didn't find Gmail there, and latestVersion became undefined - resulting in @openfn/language-gmail@undefined being passed to the docs component. I just pushed a fix that makes useProjectAdaptors merge adaptors from both sources: Backend DB (saved jobs) and Y.Doc state (unsaved jobs in the editor). That way newly added adaptors appear in projectAdaptors immediately, even before saving.

The projectAdaptors list was only populated from the database (saved
jobs). When a user added a new adaptor to a job but hadn't saved yet,
the adaptor wasn't in projectAdaptors, causing version resolution to
fail for docs loading.

Fix useProjectAdaptors to merge adaptors from both:
1. Backend DB (saved jobs)
2. Y.Doc state (unsaved jobs in the collaborative editor)

This ensures newly added adaptors appear in projectAdaptors immediately,
even before saving the workflow.
@elias-ba elias-ba self-requested a review December 5, 2025 16:43
@stuartc stuartc removed their request for review December 8, 2025 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

Some adaptor docs not loading

3 participants