hasura / hasura/graphql-engine
Do not increase reference number on each reload (unless different)
- Dominant language
- TypeScript
- Stars
- 32.1k
- Forks
- 3k
- PR merge metrics
- PR metrics pending
Description
### Version Information
Server Version: 2.1.1
### Environment
OSS
### What is the expected behaviour?
`resource_version` should probably not increase with every call to `reload_metadata`, especially if nothing changed in between reloads.
### What is the current behaviour?
We use `reload_metadata` periodically (every 3 minutes) to refresh the various remote schemas we connect to, which may change over time. Unfortunately this increases an internal `resource_version` value which may grow very large after a few days.
**My fear is that this could lead to an integer overflow of sorts after a long period of time.**
### How to reproduce the issue?
1. export metadata, look at `resource_version`
2. `reload_metadata` API call or console button
3. export metadata, look at `resource_version`
4. value has increased by one since first step
Contributor guide
Research direction
Start at the reload_metadata API and trace how resource_version is assigned when metadata is reloaded. Compare exported metadata before and after reloading unchanged metadata, then verify that unchanged reloads preserve the value while changed metadata increments it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100