Skip to content

fix(web): tolerate blocked storage and normalize catalog pagination - #4

Merged
SH20RAJ merged 4 commits into
SopKit:mainfrom
playlikeboy:fix/browser-storage-and-pagination
Nov 27, 2026
Merged

SH20RAJ merged 4 commits into
SopKit:mainfrom
playlikeboy:fix/browser-storage-and-pagination

Conversation

@playlikeboy

Copy link
Copy Markdown

Summary

  • Centralize browser-storage access behind SSR-safe helpers that catch unavailable storage, malformed JSON, invalid records, and quota/security exceptions.
  • Reuse the helpers for recently played games, favorites, and play-count tracking, so a privacy-restricted browser does not crash the game page.
  • Add tests for malformed storage values, invalid stored game objects, duplicate history entries, favorite toggling, and storage exceptions.
  • Validate game-catalog fetch responses and URL sort/page parameters, clamp pages after filtering, and avoid invalid pagination slices.

Validation

Compatibility

Existing recently-played, favorites, and most-played keys retain their current JSON format.

SH20RAJ commented Nov 27, 2026

Copy link
Copy Markdown

Maintainer review: the defensive storage helpers cover malformed JSON, invalid stored records, and browser storage failures, while the page parser now bounds invalid pagination. The storage-specific tests passed in the first CI attempt. The overall run failed in a pre-existing feed retry test from PR #1 (a permanent 404 was attempted three times); PR #6 contains the targeted fix. I’ll re-run this PR after that fix is merged before approving.

@SH20RAJ SH20RAJ left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the storage and catalog changes. localStorage access is isolated behind guarded helpers, invalid/corrupt records are filtered, pagination parameters are normalized and clamped, and rating sorting now ignores unverified legacy scores. GitHub Actions completed successfully: Bun tests and the Next.js production build both passed. Approved.

@SH20RAJ
SH20RAJ merged commit 8db948b into SopKit:main Nov 27, 2026
1 check passed
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.

2 participants