hasura / hasura/graphql-engine

Database structure changes don't trigger inconsistent metadata

Open
#8,245 0 comments 1 reaction 0 assignees View on GitHub
k/bug
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

### Version Information

Server Version: 2.2.0

### Environment

OSS

### What is the expected behaviour?

When database sources have new columns in a tracked table, I should be notified that the metadata is inconsistent

### Keywords

inconsistent metadata, database source, DDL, structure

### What is the current behaviour?

### How to reproduce the issue?

1. Add a DB as a source
2. Track a table
3. with pgadmin/psql/hasura migrations (NOT hasura console, basically), add a column to said tracked table
4. frontend will throw an error whenever browsing this table in the data panel
5. metadata is considered consistent regardless

### Screenshots or Screencast

For example, I added a `test_column` to a tracked table, and the console is upset.
![image](https://user-images.githubusercontent.com/11539524/155637705-e02805c3-142b-46e7-807c-eb1ae1491d61.png)
![image](https://user-images.githubusercontent.com/11539524/155637852-7efdeb41-efe7-4c4e-bea4-dc3023ed29c9.png)

`get_inconsistent_metadata` is quite happy nonetheless.
![image](https://user-images.githubusercontent.com/11539524/155637999-aa6577c3-197e-478b-98d1-4d7f8ec578aa.png)

### Any possible solutions?

Despite metadata not showing as inconsistent, a reload (with database sources enabled) will fix the problem.

Contributor guide

Open the contributing guide

Research direction

Start with the get_inconsistent_metadata behavior and reproduce the issue by adding a column to a tracked PostgreSQL table through pgadmin, psql, or migrations rather than the Hasura console. Trace how a reload detects the changed structure, then verify that metadata is reported as inconsistent and the data panel no longer throws an error without requiring a reload.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql
Domain
backend-api-design, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
40/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.