Better log message needed when updating an existing collection record

Open Beginner friendly
#830 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
68/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
javascript
Domain
database

Research direction

Start at line 93 of src/lib/database-client.js, where the existing-collection message is emitted, and review how the index-exists case is handled during ingest. Done means the case is logged at an informational or debug level with wording that clearly says the collection index already exists and creation is skipped.

Written by the indexing model from the issue text.

Description

Updating a collection record via ingest currently produces an error log message that seems to indicate that something went wrong. That message is like {"level":"error","message":"$COLLECTION already exists."}. I believe to most people this message would indicate that the update failed, but that is not the case.

The message is emitted here. It indicates that the index for a given collection already exists and thus there is no attempt to create it. I do not believe this case to be an error, but more informational or perhaps even debug-level. I also think the message is problematically vague, and should be explicit like "index for collection {} already exists, skipping creation".

Dominant language
TypeScript
Stars
103
Forks
28
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from stac-utils/stac-server

All issues in stac-utils/stac-server

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.