Skip to content

Add scheduled post published notification support#3327

Merged
feruzm merged 4 commits into
developmentfrom
feature/scheduled-published-notification
Jul 6, 2026
Merged

Add scheduled post published notification support#3327
feruzm merged 4 commits into
developmentfrom
feature/scheduled-published-notification

Conversation

@feruzm

@feruzm feruzm commented Jul 6, 2026

Copy link
Copy Markdown
Member

Client support for a new notification type (main_type 22, string scheduled_published): the backend will notify authors when their scheduled post goes live. Safe to merge and release ahead of the backend; deployed apps re-register device preferences that include the new type, and the daemon starts only after clients ship.

What

  • Settings toggle ("Scheduled post published") wired through the redux notification settings, default ON.
  • The three device-registration numeric maps gain the 22 entry; push tap routing, foreground banner, both delivery-path allowlists (FCM onMessage + websocket converter), and the in-app notifications tab all handle the new type, deep-linking to the published post.
  • redux-persist migration v20: without it, existing installs keep the old persisted notificationDetails shape forever and would never register the new type (autoMergeLevel1 does not merge new defaults). The migration also backfills the pre-existing missing bookmarkNotification key, fixed alongside in the reducer/typed shape.

Notes

  • Legacy realm settings schema intentionally untouched (frozen, marked for removal, already ignores bookmark).
  • Full suite passes (548 tests incl. 3 new migration tests); eslint stash-compared, zero new problems.

Summary by CodeRabbit

  • New Features
    • Added support for scheduled post published notifications across the app.
    • Added a new Settings toggle for scheduled & published alerts.
    • Updated notification routing so taps open the related post more reliably.
  • Bug Fixes
    • Improved resilience when updating notification settings, preserving existing preferences.
    • Existing installs now default the scheduled-published alert appropriately.
  • Tests
    • Added migration tests covering scheduled-published and bookmark defaulting behavior.

@greptile-apps

greptile-apps Bot commented Jul 6, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds client support for scheduled-post-published notifications. The main changes are:

  • New notification type handling for push, websocket, foreground, and in-app paths.
  • A settings toggle and device-registration mapping for type 22.
  • Persisted notification settings migration for existing installs.
  • English fallback messages for untranslated notification strings.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
src/screens/application/hook/useInitApplication.tsx Adds scheduled-post push navigation using the published post author and permlink.
src/components/foregroundNotification/foregroundNotification.tsx Adds scheduled-post foreground banner support with the delivered body preserved when present.
src/screens/application/container/applicationContainer.tsx Allows scheduled-post events through foreground delivery and includes type 22 in registration.
src/redux/reducers/applicationReducer.ts Adds scheduled-post and bookmark notification keys to the settings state shape.
src/utils/migrationHelpers.ts Backfills missing notification settings for existing persisted state.

Reviews (3): Last reviewed commit: "fix(i18n): fall back to English for untr..." | Re-trigger Greptile

Comment thread src/screens/application/hook/useInitApplication.tsx
Comment thread src/components/foregroundNotification/foregroundNotification.tsx

@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: d5c7c69819

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

/>
<SettingsItem
title={intl.formatMessage({
id: 'settings.notification.scheduled_published',

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Add fallbacks for scheduled notification copy

When the app locale is anything other than en-US, IntlProvider is initialized with only that locale's messages (src/index.tsx), and this commit adds the new scheduled-published strings only to en-US.json. This formatMessage call will therefore render the raw id for every other supported language; the foreground title/body ids added in this commit have the same issue. Please add the new keys to the other locale files, or provide defaultMessage fallbacks at each call site.

Useful? React with 👍 / 👎.

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bd3b4d22-0239-4c2b-8112-4e311c288484

📥 Commits

Reviewing files that changed from the base of the PR and between 64c6124 and 45cd02d.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (2)
  • package.json
  • src/index.tsx

📝 Walkthrough

Walkthrough

This PR adds scheduled_published notification handling across Redux state, migration logic, foreground display, notification routing, settings UI, locale strings, startup message fallback, and an SDK dependency update.

Changes

Scheduled Published Notification

Layer / File(s) Summary
Redux state, action, and migration
src/redux/constants/constants.ts, src/redux/actions/applicationActions.ts, src/redux/reducers/applicationReducer.ts, src/redux/store/store.ts, src/utils/migrationHelpers.ts, src/utils/migrationHelpers.test.ts
Adds CHANGE_SCHEDULED_PUBLISHED_NOTIFICATION, reducer state and handler, legacy payload fallback for notification settings, persist version 20, and v20 migration coverage.
Foreground and list notification display
src/components/foregroundNotification/foregroundNotification.tsx, src/components/notificationLine/view/notificationLineView.tsx, src/config/locales/en-US.json
Recognizes scheduled_published in foreground notifications, adds title/body strings, and includes the type in notification list details.
Delivery and navigation routing
src/screens/application/container/applicationContainer.tsx, src/screens/application/hook/useInitApplication.tsx, src/screens/notification/container/notificationContainer.tsx, src/screens/login/container/loginContainer.tsx
Extends notification delivery, notify-type mapping, and post navigation so scheduled_published routes to the post screen with author/permlink data.
Settings toggle UI
src/screens/settings/container/settingsContainer.tsx, src/screens/settings/screen/settingsScreen.tsx
Adds scheduledPublished state wiring and renders a new push-notification toggle.
Startup locale fallback
src/index.tsx
Merges en-US messages into the active locale messages before passing them to IntlProvider.

SDK Dependency Update

Layer / File(s) Summary
Dependency version bump
package.json
Updates @ecency/sdk from ^2.3.35 to ^2.3.36.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Poem

A scheduled post now hops along,
With titles clear and bodies strong.
The rabbit taps the toggle bright,
And finds the post by permlink light.
Old states hop safe through migration land,
With fallback messages close at hand. 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main feature added: support for the new scheduled post published notification type.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/scheduled-published-notification

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.

@coderabbitai coderabbitai 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.

🧹 Nitpick comments (1)
src/screens/application/hook/useInitApplication.tsx (1)

256-274: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider folding into the existing identical case group.

The new scheduled_published case (Lines 256-264) has the exact same body as the adjacent favorite/bookmark/reply group (Lines 265-274). Consolidating via fallthrough avoids duplicating this logic a third time.

♻️ Proposed consolidation
-        case 'scheduled_published':
-          params = {
-            author: get(push, 'source', ''),
-            permlink: fullPermlink,
-          };
-          key = fullPermlink;
-          routeName = ROUTES.SCREENS.POST;
-          break;
-
         case 'favorite':
         case 'bookmark':
         case 'reply':
+        case 'scheduled_published':
           params = {
             author: get(push, 'source', ''),
             permlink: fullPermlink,
           };
           key = fullPermlink;
           routeName = ROUTES.SCREENS.POST;
           break;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/screens/application/hook/useInitApplication.tsx` around lines 256 - 274,
The new scheduled_published branch in useInitApplication duplicates the exact
same params, key, and routeName assignment logic already handled by the adjacent
favorite/bookmark/reply case group. Fold scheduled_published into that existing
fallthrough block in the switch so the shared handling lives in one place and
the duplicated body is removed.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/screens/application/hook/useInitApplication.tsx`:
- Around line 256-274: The new scheduled_published branch in useInitApplication
duplicates the exact same params, key, and routeName assignment logic already
handled by the adjacent favorite/bookmark/reply case group. Fold
scheduled_published into that existing fallthrough block in the switch so the
shared handling lives in one place and the duplicated body is removed.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0725a954-c3aa-4a7f-a3a1-629f9302bc21

📥 Commits

Reviewing files that changed from the base of the PR and between 1e6fea2 and 64c6124.

📒 Files selected for processing (15)
  • src/components/foregroundNotification/foregroundNotification.tsx
  • src/components/notificationLine/view/notificationLineView.tsx
  • src/config/locales/en-US.json
  • src/redux/actions/applicationActions.ts
  • src/redux/constants/constants.ts
  • src/redux/reducers/applicationReducer.ts
  • src/redux/store/store.ts
  • src/screens/application/container/applicationContainer.tsx
  • src/screens/application/hook/useInitApplication.tsx
  • src/screens/login/container/loginContainer.tsx
  • src/screens/notification/container/notificationContainer.tsx
  • src/screens/settings/container/settingsContainer.tsx
  • src/screens/settings/screen/settingsScreen.tsx
  • src/utils/migrationHelpers.test.ts
  • src/utils/migrationHelpers.ts

@feruzm feruzm merged commit 1e6a25b into development Jul 6, 2026
8 of 11 checks passed
@feruzm feruzm deleted the feature/scheduled-published-notification branch July 6, 2026 20:25
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