Skip to content

fix(lana): tell the user when Salesforce Services lacks the Apex log API - #1162

Merged
lcottercertinia merged 2 commits into
certinia:mainfrom
lukecotter:bug-services-followups
Oct 8, 2026
Merged

lcottercertinia merged 2 commits into
certinia:mainfrom
lukecotter:bug-services-followups

Conversation

@lukecotter

Copy link
Copy Markdown
Collaborator

📝 PR Overview

Follows #1161. When the installed Salesforce Services did not have a method that lana calls, Retrieve Log did nothing and showed no message.

There were two causes, and they come from one mechanism:

  • Services gives its services as Effect tags with accessors. An accessor tag answers to any method name. For a method that the service does not have, the call succeeds with undefined.
  • lana's API check (isSalesforceServicesApi) read the methods from those tags, so the check always passed.
  • RetrieveLogFile then read the undefined result as "the user closed the picker", and stopped with no message.

This PR makes the check look at the real service instances in prebuiltServicesDependencies. A Services version without the API now gets lana's existing message, the same notification as when Services is not installed:

The installed Salesforce Services extension does not expose the required Apex log API. Update it and try again. [Install or Update Salesforce Services]

🛠️ Changes made

  • servicesRuntime.ts: isSalesforceServicesApi gets each service from the Effect context by its tag, and checks the methods on that instance.
  • servicesRuntime.test.ts:
    • The test API uses real Effect.Service tags with accessors, as Services does.
    • New tests: an instance that does not have a method its tag answers to, and a context that does not have one of the services.
  • test/playwright/support/logAnalysis.ts: openLogAnalysis uses executeCommandWithCommandPalette, as the Retrieve Log spec does.

🧩 Type of change (check all applicable)

  • 🐛 Bug fix - something not working as expected
  • ✨ New feature – adds new functionality
  • ♻️ Refactor - internal changes with no user impact
  • ⚡ Performance Improvement
  • 📝 Documentation - README or documentation site changes
  • 🔧 Chore - dev tooling, CI, config
  • 💥 Breaking change

🔗 Related Issues

Follows #1161.

✅ Tests added?

  • 👍 yes

  • 🙅 no, not needed

  • 🙋 no, I need help

  • The two new unit tests fail with the old check and pass with the new one. All 338 lana tests pass.

  • Both web e2e specs pass with the real Services extension.

  • With a method name that Services does not have, the e2e run shows the "Update it" notification above, and the Retrieve Log spec fails, as it should.

📚 Docs updated?

  • 🔖 README.md
  • 🔖 CHANGELOG.md
  • 📖 help site
  • 🧪 Marked any pre-release-only features (README 🧪 badge — see RELEASING.md)
  • 🙅 not needed

Anything else we need to know? [optional]

  • The check covers the four methods that lana calls today. salesforceServices.ts still calls them through the accessor tags. So a method added later, but not added to the check, would again give undefined and not an error.
  • The new check needs the tags and the context to be Effect 3 objects. If Services moves to Effect 4, lana's own runtime also needs a change.

@lcottercertinia
lcottercertinia merged commit a0f1da1 into certinia:main Oct 8, 2026
9 checks passed
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