Skip to content

Conversation

@justinmk3
Copy link
Contributor

@justinmk3 justinmk3 commented Apr 16, 2025

continues #7043

Problem:

Manifest resolver always reports:

Failed to download latest "…" manifest. Falling back to local manifest.

Solution:

  • In fetchRemoteManifest(), if the ETag indicates no new manifest is needed, return the local manifest instead of throwing an error
  • Fix other ambiguous/misleading log messages.

  • Treat all work as PUBLIC. Private feature/x branches will not be squash-merged at release time.
  • Your code changes must meet the guidelines in CONTRIBUTING.md.
  • License: I confirm that my contribution is made under the terms of the Apache 2.0 license.

@github-actions
Copy link

  • This pull request modifies code in src/* but no tests were added/updated.
    • Confirm whether tests should be added or ensure the PR description explains why tests are not required.
  • This pull request implements a feat or fix, so it must include a changelog entry (unless the fix is for an unreleased feature). Review the changelog guidelines.
    • Note: beta or "experiment" features that have active users should announce fixes in the changelog.
    • If this is not a feature or fix, use an appropriate type from the title guidelines. For example, telemetry-only changes should use the telemetry type.

Problem:
Ambiguous or misleading log messages.

Solution:
Refine the logging logic.
@justinmk3 justinmk3 changed the title fix(lsp): install failure does not give enough info fix(lsp): manifest resolver always reports "Failed to download" Apr 16, 2025
@justinmk3 justinmk3 marked this pull request as ready for review April 16, 2025 20:13
@justinmk3 justinmk3 requested review from a team as code owners April 16, 2025 20:13
const resolved = await tryStageResolvers('getServer', serverResolvers, getServerVersion)
return resolved
} finally {
logger.info(`Finished setting up LSP server`)
Copy link
Contributor Author

@justinmk3 justinmk3 Apr 16, 2025

Choose a reason for hiding this comment

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

Removed this finally. If an exception was thrown, it didn't really "finish" setup?

Comment on lines 66 to +67
if (!resp.content) {
throw new ToolkitError(
`New content was not downloaded; fallback to the locally stored "${this.lsName}" manifest`
)
const msg = `"${this.lsName}" manifest unchanged, skipping download: ${this.manifestURL}`
Copy link
Contributor Author

@justinmk3 justinmk3 Apr 16, 2025

Choose a reason for hiding this comment

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

!resp.content means "etag didnt change". It doesn't mean "failed to download".

The old code would always report a failed languageServer_setup in the common case (where etag didn't change).

Comment on lines +70 to +72
const localManifest = await this.getLocalManifest(true).catch(() => undefined)
if (localManifest) {
localManifest.location = 'remote'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The common case is that etag didnt change. So that's handled here by re-using getLocalManifest. ManifestResolver doesn't have a way to tell its caller "I didnt fail but please continue to the next step".

Comment on lines -80 to +88
logger.info(`Failed to download latest "${this.lsName}" manifest. Falling back to local manifest.`)
private async getLocalManifest(silent: boolean = false): Promise<Manifest> {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Always reporting "failed to download" here is misleading because this will happen when "etag didnt change".

[this.lsName]: {
etag,
// XXX: this stores the entire manifest. vscode warns about our globalStorage size...
content,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we are storing the entire manifest in globalStorage :/

@justinmk3 justinmk3 force-pushed the fixlspinstall branch 2 times, most recently from 5e4bfe6 to 3d5fa82 Compare April 16, 2025 22:45
Problem:
Manifest resolver always reports:

    Failed to download latest "…" manifest. Falling back to local manifest.

Solution:
In `fetchRemoteManifest()`, if the ETag indicates no new manifest is
needed, return the local manifest instead of throwing an error
@justinmk3 justinmk3 merged commit 460321a into aws:master Apr 16, 2025
31 checks passed
@justinmk3 justinmk3 deleted the fixlspinstall branch April 16, 2025 23:11
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