Skip to content

feat(news): hook settings to the backend #17817

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jrainville
Copy link
Member

Fixes #17811

Based on top of #17809
Status-go PR: status-im/status-go#6540

Hooks the NewsFeedNotification setting and the RSS setting to the backend.

The Notification setting has a bit of complexity on the service side, because while the UI setting is a select of 3 options, the status-go settings are actually 2 bool settings. So the service does some logic to set the right setting from those two.

The settings are used to disable the polling if one of the settings is disabled. If the setting is on DeliverQuietly, the AC notif is shown, but no OS or toast notification

What does the PR do

Hooks the UI settings to the backend settings. Makes the UX for the News Feed complete, once the feature flag on the status-go side is enabled and once we'll have a good RSS feed for Status

Affected areas

  • Nim Settings (adds the QtProperties to access the RSS and notification settings, ie the backend getters and setters)
  • Notification manager (skip OS and Toast notif if notif is OFF or DeliverQuietly)
  • Modifies/Fixes the QML code a little to be able to set the properties properly

Architecture compliance

Screenshot of functionality

settings-hooked.webm

Impact on end user

None without the feature flag on
Once it's turned on, it let's users choose the right settings for notifications or if they want to disable the feature altogether.

How to test

  • Play with the settings in the Notifications settings, the Privacy settings and in the AC screen

Risk

Nonce since the feature flag is disabled

Tick one:

  • Low risk: 2 devs MUST perform testing as specified above and attach their results as comments to this PR before merging.
  • High risk: QA team MUST perform additional testing in the specified affected areas before merging.

@jrainville jrainville requested review from micieslak, caybro, alexjba and a team as code owners April 18, 2025 17:16
@jrainville jrainville requested a review from a team April 18, 2025 17:16
@status-im-auto
Copy link
Member

status-im-auto commented Apr 18, 2025

Jenkins Builds

Click to see older builds (7)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 2b837e2 #1 2025-04-18 17:25:13 ~8 min tests/nim 📄log
✔️ 2b837e2 #1 2025-04-18 17:26:05 ~9 min macos/aarch64 🍎dmg
✔️ 2b837e2 #1 2025-04-18 17:30:44 ~14 min tests/ui 📄log
2b837e2 #1 2025-04-18 17:36:10 ~19 min windows/x86_64 📄log
✔️ 2b837e2 #1 2025-04-18 17:38:08 ~21 min macos/x86_64 🍎dmg
✔️ 2b837e2 #1 2025-04-18 17:40:13 ~23 min linux/x86_64 📦tgz
✔️ 2b837e2 #1 2025-04-18 17:41:30 ~24 min linux-nix/x86_64 📦tgz
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ e4ab15d #2 2025-04-22 17:19:44 ~7 min macos/aarch64 🍎dmg
✔️ e4ab15d #2 2025-04-22 17:21:20 ~9 min tests/nim 📄log
✔️ e4ab15d #2 2025-04-22 17:25:19 ~13 min tests/ui 📄log
✔️ e4ab15d #2 2025-04-22 17:27:07 ~14 min macos/x86_64 🍎dmg
e4ab15d #2 2025-04-22 17:30:34 ~18 min windows/x86_64 📄log
✔️ e4ab15d #2 2025-04-22 17:34:55 ~22 min linux-nix/x86_64 📦tgz
✔️ e4ab15d #2 2025-04-22 17:37:20 ~25 min linux/x86_64 📦tgz
e4ab15d #3 2025-04-23 09:24:59 ~4 min macos/aarch64 📄log
✔️ e4ab15d #3 2025-04-23 09:30:34 ~9 min tests/nim 📄log
✔️ e4ab15d #3 2025-04-23 09:34:05 ~13 min tests/ui 📄log
✔️ e4ab15d #3 2025-04-23 09:36:08 ~15 min macos/x86_64 🍎dmg
e4ab15d #3 2025-04-23 09:39:30 ~18 min windows/x86_64 📄log
✔️ e4ab15d #3 2025-04-23 09:43:35 ~22 min linux/x86_64 📦tgz
✔️ e4ab15d #3 2025-04-23 09:44:40 ~23 min linux-nix/x86_64 📦tgz
✔️ 468275a #4 2025-04-23 14:55:19 ~8 min macos/aarch64 🍎dmg
✔️ 468275a #4 2025-04-23 14:55:53 ~8 min tests/nim 📄log
✔️ 468275a #4 2025-04-23 15:00:54 ~13 min tests/ui 📄log
✔️ 468275a #4 2025-04-23 15:02:12 ~15 min macos/x86_64 🍎dmg
468275a #4 2025-04-23 15:06:14 ~19 min windows/x86_64 📄log
✔️ 468275a #4 2025-04-23 15:08:40 ~21 min linux-nix/x86_64 📦tgz
✔️ 468275a #4 2025-04-23 15:09:30 ~22 min linux/x86_64 📦tgz

Copy link
Member

@caybro caybro left a comment

Choose a reason for hiding this comment

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

LGTM in general

@@ -11,9 +11,11 @@ QtObject {
readonly property string keyUid: userProfile.keyUid

// The following properties wrap Privacy and Security View related properties:
property bool isStatusNewsViaRSSEnabled: true /*TODO: Connect it to the backend corresponding property*/
property bool isStatusNewsViaRSSEnabled: appSettings.newsRSSEnabled
Copy link
Member

Choose a reason for hiding this comment

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

readonly

@@ -55,6 +55,9 @@ const PROFILE_MIGRATION_NEEDED* = "profile-migration-needed"
const KEY_URL_UNFURLING_MODE* = "url-unfurling-mode"
const KEY_AUTO_REFRESH_TOKENS* = "auto-refresh-tokens-enabled"
const KEY_LAST_TOKENS_UPDATE* = "last-tokens-update"
const KEY_NEWS_FEED_ENABLED* = "news-feed-enabled?"
const KEY_NEWS_NOTIFICATIONS_ENABLED* = "news-notifications-enabled?"
const KEY_NEWS_RSS_ENABLED* = "news-rss-enabled?"
Copy link
Member

Choose a reason for hiding this comment

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

I just wouldn't use the question marks in the settings' keys

Copy link
Contributor

Choose a reason for hiding this comment

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

Agree

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah I get your point, but I can't do much about it, it was merged already with the question mark in status-go (not my PR)

Copy link
Member

Choose a reason for hiding this comment

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

Wait...but these are also used as keys for our QSettings?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think so. I see that we only use them in the service and/or DTO. I renamed the Nim properties and QProperties to something nicer like newsRSSEnabled.

Copy link
Contributor

@noeliaSD noeliaSD left a comment

Choose a reason for hiding this comment

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

Good job!!

I have some doubts (probably only related to the UI integration), added as review comments.

# We convert the bools to the right setting
# Send alerts means the News Feed is enabled + notifications are enabled
# Deliver quietly means the News Feed is enabled + notifications are disabled
# Turn off means the News Feed is disabled
Copy link
Contributor

Choose a reason for hiding this comment

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

Just to clarify.. since it confused me when I was reading!

Suggested change
# Turn off means the News Feed is disabled
# Turn off means the News Feed is disabled + notifications are disabled

@@ -11,9 +11,11 @@ QtObject {
readonly property string keyUid: userProfile.keyUid

// The following properties wrap Privacy and Security View related properties:
property bool isStatusNewsViaRSSEnabled: true /*TODO: Connect it to the backend corresponding property*/
property bool isStatusNewsViaRSSEnabled: appSettings.newsRSSEnabled
Copy link
Contributor

Choose a reason for hiding this comment

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

Now it would be better:

Suggested change
property bool isStatusNewsViaRSSEnabled: appSettings.newsRSSEnabled
readonly property bool isStatusNewsViaRSSEnabled: appSettings.newsRSSEnabled

@jrainville jrainville force-pushed the feat/news-hook-settings branch from 2b837e2 to e4ab15d Compare April 22, 2025 17:11
Base automatically changed from feat/issue-17795 to master April 23, 2025 09:20
Fixes #17811

Hooks the NewsFeedNotification setting and the RSS setting to the backend.
The Notification setting has a bit of complexity on the service side, because while the UI setting is a select of 3 options, the status-go settings are actually 2 bool settings. So the service does some logic to set the right setting from those two.
The settings are used to disable the polling if one of the settings is disabled. If the setting is on DeliverQuietly, the AC notif is shown, but no notificaiton
@jrainville jrainville force-pushed the feat/news-hook-settings branch from e4ab15d to 468275a Compare April 23, 2025 14:46
@jrainville jrainville requested review from caybro and noeliaSD April 23, 2025 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[News Feed] Hook the News Feed and RSS UI settings to the backend
4 participants