Skip to content

fix: correct copy-paste error in Redux migration 18 (readingPreferences -> audioPlayerState) - #3312

Open
Mubashir78 wants to merge 2 commits into
quran:productionfrom
Mubashir78:fix/redux-migration-18-reading-preferences
Open

fix: correct copy-paste error in Redux migration 18 (readingPreferences -> audioPlayerState)#3312
Mubashir78 wants to merge 2 commits into
quran:productionfrom
Mubashir78:fix/redux-migration-18-reading-preferences

Conversation

@Mubashir78

Copy link
Copy Markdown

Summary

Fixes #3088

Root Cause

Migration 18 in src/redux/migrations.ts had a copy-paste error: it spread state.readingPreferences into audioPlayerState instead of state.audioPlayerState. This corrupts the audio player state by overwriting it with reading preferences data.

// Before (buggy)
18: (state) => ({
    ...state,
    audioPlayerState: {
      ...state.readingPreferences, // BUG: should be ...state.audioPlayerState
      showTooltipWhenPlayingAudio: false,
    },
  }),

// After (fixed)
18: (state) => ({
    ...state,
    audioPlayerState: {
      ...state.audioPlayerState,
      showTooltipWhenPlayingAudio: false,
    },
  }),

Checklist

  • The change is small and targeted (single character class fix)
  • Follows existing code conventions
  • No breaking changes to the state shape

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bbd5188143

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/redux/migrations.ts
…State

Bump persist version to 49 and add migration that resets audioPlayerState to only known AudioState keys, clearing any readingPreferences keys spilled by the copy-paste bug in historical migration 18.
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.

[bug]: Bug in Redux Migrations

1 participant