Skip to content

feat: improve Shanghai hotel discovery and tracking - #16

Merged
hoangsvit merged 21 commits into
mainfrom
fix/hotel-nav-and-workflow-race
Aug 27, 2026
Merged

feat: improve Shanghai hotel discovery and tracking#16
hoangsvit merged 21 commits into
mainfrom
fix/hotel-nav-and-workflow-race

Conversation

@hoangsvit

@hoangsvit hoangsvit commented Aug 27, 2026

Copy link
Copy Markdown
Member

Summary

  • expose Giá phòng / Hotel Prices from the dashboard and flight tracker
  • switch hotel discovery to broad Shanghai hotels search, then filter on the client
  • bootstrap the catalog with 5 Google Hotels pages after merge/push
  • keep scheduled daily refresh light at 3 pages to reduce SerpApi usage
  • allow manual runs with 3 / 5 / 8 pages
  • dedupe by property_token/name, calculate distance from 531 Jinling East Road, and estimate a nearby landmark area
  • preserve hotels discovered by a deeper run when a later 3-page refresh does not return them; preserved hotels keep metadata but their old live price is deliberately cleared
  • add full browser filters: search, distance, area, min/max price, rating, review count, star class, amenity, priced-only, favorites-only
  • use browser-local Quan tâm / Favorites instead of a hard-coded shortlist
  • reject 0-property Google Hotels responses instead of committing an empty snapshot
  • remove the old 10-hotel fallback snapshot so preview cannot look like real API data when API count is actually zero
  • serialize Flight + Hotel writer workflows and rebase before push to prevent non-fast-forward failures

Hotel discovery flow

merge/push: Shanghai hotels -> up to 5 pages
manual:     Shanghai hotels -> choose 3 / 5 / 8 pages
scheduled:  Shanghai hotels -> up to 3 pages

API results
  -> merge properties + non_matching_properties
  -> dedupe by property_token/name
  -> calculate distance/area metadata
  -> preserve deeper catalog metadata from earlier runs
  -> clear stale price for hotels not seen in latest refresh
  -> save data/hotels.json
  -> user filters manually in hotels.html

Data safety

  • ZERO_RESULTS exits with an error and does not overwrite the last good snapshot.
  • The workflow validates raw_property_count, latest_unique_property_count, and pages_fetched before committing.
  • Price history is written only for hotels that have a live rate in the latest Google Hotels response.

Workflow write serialization

concurrency:
  group: price-tracker-writes-${{ github.ref }}
  cancel-in-progress: false

The generated-data commit also fetches/rebases the branch immediately before push as a final guard against a concurrent human update.

@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

🌍 Web preview

Preview is pinned to commit b2af2ba and updates automatically when the PR changes.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 7fd523ab-d3e0-48d6-b63e-00b1af0a3c90


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@hoangsvit hoangsvit changed the title fix: expose hotel tracker and serialize price updates feat: improve Shanghai hotel discovery and tracking Aug 27, 2026
@hoangsvit
hoangsvit merged commit 556ac3d into main Aug 27, 2026
2 checks passed
@hoangsvit
hoangsvit deleted the fix/hotel-nav-and-workflow-race branch August 27, 2026 10:27
@hoangsvit
hoangsvit restored the fix/hotel-nav-and-workflow-race branch August 27, 2026 12:38
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