microsoft / microsoft/vscode-pgsql

Deep refresh error: Failed to deep refresh: An item with the provided index does not exist

Open
#250 13 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug needs-verify
Dominant language
No language data
Stars
395
Forks
33
Avg merge
1h 46m
Merged PRs (30d)
3

Description

Describe the bug

Trying to refresh an object which already doesn't exist in DB results in an error.

To Reproduce

Steps to reproduce the behavior:

  1. Expand to a table in a db.
  2. Drop the table.
  3. Click the refresh icon on the table
  4. See the table has not disappeared and VS shows an error: "[9:37:09 PM] [ObjectExplorerService] [Error]: Deep refresh error: Failed to deep refresh: An item with the provided index does not exist"

Expected behavior

Try to refresh each root until a root that exists is found or go up to refreshing the whole connection.

BTW. The behavior seems to be different for columns and tables. If I click refresh on a column that is already deleted, I see no issue and the column disappears (see "getting children for node" on the screenshot). I go upwards and try to refresh the table which contained the column and get the error.

Screenshots

Click refresh on a table:
Image

VS Code version

1.116.0

Extension Logs

Version: 1.20.0

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.

Research direction

Start by reproducing the table-refresh sequence in the ObjectExplorerService shown in the extension logs, then compare it with the reported column-refresh behavior. Trace how refresh handles a deleted table and verify that it searches upward for an existing root or refreshes the connection without the reported error, while removing the stale table.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.