Skip to content

fix: Use relative time when viewing logs/events when a node is still running#1977

Open
yuechao-qin wants to merge 1 commit intomasterfrom
ycq/fix-observe-log-events-relative-time
Open

fix: Use relative time when viewing logs/events when a node is still running#1977
yuechao-qin wants to merge 1 commit intomasterfrom
ycq/fix-observe-log-events-relative-time

Conversation

@yuechao-qin
Copy link
Collaborator

@yuechao-qin yuechao-qin commented Mar 20, 2026

Description

Closes https://github.com/Shopify/oasis-frontend/issues/526

When a node is still running, the old code would put hard code start and end time relative to the current time the user views the node. Issues with this is:

  • Goes out of sync with latest logs/events
  • Didn't work if it's still running, because the end time had a padding of 5 additional minutes into the future (the padding was meant for when a run is completed).

Now, the code does:

  • If start time is missing -- Use relative time for the past hour to retrieve logs/events.
  • If end time is missing -- Use relative time for the past minutes (plus 5 minute padding) the node has been running to retrieve logs/events.
  • If start/end are available -- Use static start/end times with 5 minute padding.

Related Issue and Pull requests

Type of Change

  • Bug fix
  • New feature
  • Improvement
  • Cleanup/Refactor
  • Breaking change
  • Documentation update

Checklist

  • I have tested this does not break current pipelines / runs functionality
  • I have tested the changes on staging

Test Instructions

  • Find a run that a node has not finished
  • Click on that node and go to logs panel
  • Click on both Observe's logs/events that goes to the site.
    • Confirm the time range is using now with some minutes
    • Confirm running the query doesn't fail

Video

Use cases:

  • Node running
  • Node ended recently (within 5 minutes of current time)
  • Node completed for a while

Screen Recording 2026-03-20 at 3.28.43 PM.mov (uploaded via Graphite)

@github-actions
Copy link

github-actions bot commented Mar 20, 2026

🎩 To tophat this PR:

You can add the following URL parameter to your browser to tophat this PR:

`?tophat_location=ycq/fix-observe-log-events-relative-time/d106cbe`

Copy link
Collaborator Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@yuechao-qin yuechao-qin force-pushed the ycq/fix-observe-log-events-relative-time branch from ce826a9 to 710d4af Compare March 20, 2026 22:15
@yuechao-qin yuechao-qin force-pushed the ycq/fix-observe-log-events-relative-time branch from 710d4af to d106cbe Compare March 20, 2026 22:19
@yuechao-qin yuechao-qin marked this pull request as ready for review March 20, 2026 22:33
@yuechao-qin yuechao-qin requested a review from a team as a code owner March 20, 2026 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant