Skip to content

fix(store): replace @ts-ignore with ReduxStoreWithManager casting in store.ts - #66

Open
aryunewaskar77-art wants to merge 10 commits into
hiero-ledger:mainfrom
aryunewaskar77-art:fix/store-reducer-manager-type-casting
Open

fix(store): replace @ts-ignore with ReduxStoreWithManager casting in store.ts#66
aryunewaskar77-art wants to merge 10 commits into
hiero-ledger:mainfrom
aryunewaskar77-art:fix/store-reducer-manager-type-casting

Conversation

@aryunewaskar77-art

@aryunewaskar77-art aryunewaskar77-art commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Removes the @ts-ignore bypass in store.ts and replaces it with
a proper ReduxStoreWithManager cast.

Problem

The store was using @ts-ignore to bypass TypeScript when assigning
reducerManager to the store object:

// @ts-ignore
store.reducerManager = reducerManager;

This silences the compiler completely, which is dangerous — any future
changes to the store shape would go undetected.

Fix

Cast the store using the existing ReduxStoreWithManager interface
that was already defined for this exact purpose:

const store = configureStore({ ... }) as ReduxStoreWithManager;
store.reducerManager = reducerManager;

Notes

  • This fix pairs naturally with the reducerManager.ts type fixes
    in the previously merged PR
  • Runtime logic is completely unchanged
  • lint:ts passes with 0 errors

Comment thread heka-identity-service/docs/setup.md Outdated
> ```bash
> npm_config_python=/path/to/python3.11 yarn install
> ``
### Fixing node-gyp issues with Python 3.12

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same as #62 (comment)

@aryunewaskar77-art
aryunewaskar77-art force-pushed the fix/store-reducer-manager-type-casting branch from 6b63cb4 to 1e7cf12 Compare April 30, 2026 19:55
@aryunewaskar77-art

Copy link
Copy Markdown
Contributor Author

@AlexanderShenshin, the requested changes have been made PTAL!

…store.ts

Signed-off-by: Aaryaa Newaskar <aryu.newaskar77@gmail.com>
@aryunewaskar77-art
aryunewaskar77-art force-pushed the fix/store-reducer-manager-type-casting branch from bf70466 to 736c530 Compare April 30, 2026 20:01
@AlexanderShenshin

Copy link
Copy Markdown
Contributor

Hi @aryunewaskar77-art, please check pipeline failure.

Signed-off-by: Aaryaa Newaskar <aryu.newaskar77@gmail.com>
Signed-off-by: Aaryaa Newaskar <aryu.newaskar77@gmail.com>
…rovider

Signed-off-by: Aaryaa Newaskar <aryu.newaskar77@gmail.com>
… type

Signed-off-by: Aaryaa Newaskar <aryu.newaskar77@gmail.com>
@AlexanderShenshin

Copy link
Copy Markdown
Contributor

@aryunewaskar77-art, does the build work fine for you locally?
If not, please make sure that it is before committing (it's not very effective to debug such things via PR pipelines).

@aryunewaskar77-art

aryunewaskar77-art commented May 4, 2026

Copy link
Copy Markdown
Contributor Author

Sorry for the trouble sir, but this time I did check in the local and then made the commit.

@AlexanderShenshin

Copy link
Copy Markdown
Contributor

No worries, thanks.


export interface ReduxStoreWithManager extends EnhancedStore<StateSchema> {
reducerManager: ReducerManager;
dispatch: ThunkDispatch<StateSchema, ThunkExtraArg, UnknownAction>;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why we want to add this type definition?

As far as I see, we're still using type assertion with "unknown assertion" first (as unknown as ReduxStoreWithManager), so can we say that the issue is actually fixed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, the issue is actually fixed because we use a cast once in the "factory" (createReduxStore) so that entire codebase can be clean and type-safe.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'd say that cast is a problematic solution by itself and we still need to have a TODO or FIXME comment if we're going to rely on the cast...

Is it possible to resolve typecheck errors without a cast in this case?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That's a fair point, the cast is a workaround since StateSchema has required properties but delete removes them at runtime. Making keys optional would fix it properly but adds null checks everywhere across selectors and components.
Adding a FIXME comment to flag the debt as suggested - let me know if you'd prefer a different approach.

@aryunewaskar77-art

Copy link
Copy Markdown
Contributor Author

@AlexanderShenshin, my PR have passed all the checks successfully.
Whenever you get the chance, could you please review/merge them?
Let me know if any changes are needed from my side. Thanks!

@AlexanderShenshin AlexanderShenshin self-assigned this May 13, 2026

@AlexanderShenshin AlexanderShenshin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

TODO or FIXME comment for casts is still unaddressed.

@lfdt-bot

lfdt-bot commented Jul 27, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@aryunewaskar77-art, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 37 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: b25710f5-3c56-4fd0-96f4-b86c5b465582

📥 Commits

Reviewing files that changed from the base of the PR and between d5faadc and 1e6bfe7.

📒 Files selected for processing (1)
  • heka-identity-service-web-ui/src/app/providers/StoreProvider/config/store.ts

Walkthrough

Changes

Identity service store typing

Layer / File(s) Summary
Reducer manager contracts
heka-identity-service-web-ui/src/app/providers/StoreProvider/config/StateSchema.ts, heka-identity-service-web-ui/src/app/providers/StoreProvider/config/reducerManager.ts
Reducer typing now uses Redux contracts, thunk-aware dispatch is explicit, and reducer/state key deletion uses typed casts instead of TypeScript suppression.
Store and loader integration
heka-identity-service-web-ui/src/app/providers/StoreProvider/config/store.ts, heka-identity-service-web-ui/src/shared/lib/components/DynamicModuleLoader/DynamicModuleLoader.tsx
Store creation and dynamic module loading now use ReduxStoreWithManager, with the reducer manager passed directly to configureStore.

Wallet notification badges

Layer / File(s) Summary
Notification badge rendering
heka-wallet/app/src/navigators/TabStack.tsx, heka-wallet/app/src/screens/Home.tsx
Navigation and Home notification badges receive numeric counts directly while retaining their existing layout and color styling.

Estimated code review effort: 2 (Simple) | ~15 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main store typing change and matches the primary changeset.
Description check ✅ Passed The description is directly related to the store typing fix and accurately summarizes the change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

aryunewaskar77-art and others added 3 commits July 27, 2026 19:38
Signed-off-by: aryunewaskar77-art <aaryaanewaskar@gmail.com>
Signed-off-by: aryunewaskar77-art <aryu.newaskar77@gmail.com>
Signed-off-by: aryunewaskar77-art <aryu.newaskar77@gmail.com>
@aryunewaskar77-art
aryunewaskar77-art force-pushed the fix/store-reducer-manager-type-casting branch from 0609d01 to a99de3e Compare July 27, 2026 14:23
Signed-off-by: Aaryaa Newaskar <aryu.newaskar77@gmail.com>
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.

3 participants