hasura / hasura/graphql-engine

Event triggers created_at time shifted +09:00

Open
#10,308 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

c/console k/bug
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

### Version Information

Server Version: v2.40.0

### Environment

OSS

### What is the current behaviour?

The created_at values displayed on the Processed Events page and Invocation Logs page in the Hasura Console are offset by 9 hours.

### What is the expected behaviour?

The values should display the actual time when the events were executed (i.e., the values should reflect the time 9 hours earlier).

### How to reproduce the issue?

1. Create an event that triggers when data is INSERTed into any table.
2. Perform an INSERT operation on the table.
3. Check the logs on the Hasura Console's Events page.

### Screenshots or Screencast

![image](https://github.com/hasura/graphql-engine/assets/703006/f4bde766-b229-4501-bf5c-3bad6a201777)

![image](https://github.com/hasura/graphql-engine/assets/703006/42be2638-8006-456b-8d4d-ea89e2200f6e)

### Please provide any traces or logs that could help here.

Event payload:
```
{
"headers": [
{
"name": "Content-Type",
"value": "application/json"
},
{
"name": "User-Agent",
"value": "hasura-graphql-engine/v2.40.0"
}
],
"payload": {
"created_at": "2024-06-24T14:22:32.128413",
"delivery_info": {
"current_retry": 0,
"max_retries": 0
},
"event": {
"data": {
"new": {
:(snip)
```

### Any possible solutions/workarounds you're aware of?

Execute the following SQL commands:
```
ALTER TABLE hdb_catalog.event_invocation_logs
ALTER COLUMN created_at TYPE TIMESTAMPTZ;

ALTER TABLE hdb_catalog.event_log
ALTER COLUMN created_at TYPE TIMESTAMPTZ;
```

Ref.
https://github.com/hasura/graphql-engine/issues/5722

### Keywords

event trigger, time zone, TIMESTAMPTZ

Contributor guide

Open the contributing guide

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 with the Hasura Console's Processed Events and Invocation Logs pages, then inspect the event_invocation_logs and event_log created_at columns referenced in the workaround. Reproduce an INSERT-triggered event and compare the displayed time with the event payload. Done means both pages show the actual execution time without the nine-hour offset, with coverage for the affected timestamp handling.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql, typescript
Domain
databases, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.