Repository navigation
test(lana): check Retrieve Log reaches Salesforce Services in VS Code Web - #1161
Merged
lcottercertinia merged 2 commits intoOct 8, 2026
Merged
Conversation
lcottercertinia
approved these changes
Oct 8, 2026
3 of 15 tasks
lcottercertinia
pushed a commit
that referenced
this pull request
Oct 8, 2026
…API (#1162) # 📝 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) - [x] 🐛 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? - [x] 👍 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](../RELEASING.md#-marking-pre-release-only-features)) - [x] 🙅 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
📝 PR Overview
CI downloads Salesforce Services for the web e2e tests, but no test used it. The only spec opens a sample log, and lana calls Services only from Retrieve Log. A Services release that broke lana's wiring would pass CI.
This PR adds a web e2e test for that wiring. It also corrects two notes that said the e2e tests cannot load Services from the marketplace.
🛠️ Changes made
retrieveLog.web.spec.ts:Error loading logfile: …instanceUrl…. Services' own connection layer gives that error, so only a call that got through lana's wiring gets that far. A failed activation, or a call to a method that Services does not have, fails before it.executeCommandWithCommandPaletteandwaitForNotificationfrom@salesforce/playwright-vscode-ext.DEVELOPING.mdand theheadlessServer.tswarning: the e2e browser turns off web security (--disable-web-securityincreateWebConfig), so it loads Services from the marketplace. Only a normal browser onlocalhostcannot. The warning is also shorter.🧩 Type of change (check all applicable)
🔗 Related Issues
None.
✅ Tests added?
👍 yes
🙅 no, not needed
🙋 no, I need help
Both web specs pass with a local Services copy (the path CI uses) and with the marketplace copy.
The new test fails, as it should, when lana calls a renamed Services method.
📚 Docs updated?
🧪badge — see RELEASING.md)Anything else we need to know? [optional]
The CI download stays. Without it, each test downloads Services (about 7.6 MB) from the marketplace CDN, because each test gets a new browser and Services activates on
*. That added about 1.2 s per test.Found while writing the test, not fixed here:
isSalesforceServicesApicannot detect a renamed Services method.ApexLogServiceuses Effect accessors, which return a function for any property name, so itstypeof … === 'function'checks always pass. A minimum Services version check would work.