Blogging prompt notifications never report dismissals
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 79/100
Línea de trabajo
Empieza en WordPress/Classes/Utility/Notifications/InteractiveNotificationsManager.swift, donde notificationCategory() actualmente pasa opciones vacías, aunque .bloggingPrompt define .customDismissAction. Lee también handleLocalNotificationAction, ya que al gestionar los cierres también podría registrarse un evento recibido. Ejecuta las dos pruebas NoteCategoryDefinitionTests mencionadas en Tests/KeystoneTests/Tests/Utility/NoteCategoryDefinitionTests.swift; se considera terminado cuando la categoría solicita que se informe del cierre y el comportamiento del evento se gestiona según lo previsto.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Split from #6254. Dismissing a blogging prompt notification is never reported to the app, so the blogging_reminders_notification_prompt_dismissed event has never been sent.
What happens
The app asks iOS to report dismissals of blogging prompt notifications, but the request never reaches iOS:
NoteCategoryDefinition.notificationCategoryOptionsreturns[.customDismissAction]for.bloggingPrompt.notificationCategory()never uses it. It always passes empty options:options: UNNotificationCategoryOptions().- So iOS never reports a dismissal. The
UNNotificationDismissActionIdentifierbranch inhandleLocalNotificationAction, which trackspromptsNotificationDismissed, has never run.
Both lines were added together in 4a03aa458a (May 2022) and haven't changed since. Everything is in WordPress/Classes/Utility/Notifications/InteractiveNotificationsManager.swift.
Failing test
bloggingPromptCategoryRequestsDismissAction fails on trunk (iOS 27 simulator, run 2026-10-27):
Expectation failed: category.options.contains(.customDismissAction)
category.options → UNNotificationCategoryOptions(rawValue: 0)
.customDismissAction → UNNotificationCategoryOptions(rawValue: 1)
Test (new file Tests/KeystoneTests/Tests/Utility/NoteCategoryDefinitionTests.swift)
import Testing
import UserNotifications
@testable import WordPress
struct NoteCategoryDefinitionTests {
/// The blogging prompt category asks iOS to report dismissals, but the option is
/// never passed to `UNNotificationCategory`, so iOS never reports them.
@Test func bloggingPromptCategoryRequestsDismissAction() {
let category = InteractiveNotificationsManager.NoteCategoryDefinition.bloggingPrompt.notificationCategory()
#expect(category.options.contains(.customDismissAction))
}
@Test func categoriesWithoutListedOptionsHaveNone() {
let category = InteractiveNotificationsManager.NoteCategoryDefinition.mediaUploadSuccess.notificationCategory()
#expect(category.options.isEmpty)
}
}
KeystoneTests is a synchronized folder and already in WordPressUnitTests.xctestplan, so no project changes are needed.
Fix
Pass the options through in notificationCategory():
func notificationCategory() -> UNNotificationCategory {
UNNotificationCategory(
identifier: identifier,
actions: actions.map({ $0.notificationAction() }),
intentIdentifiers: [],
options: UNNotificationCategoryOptions(notificationCategoryOptions)
)
}
Verified: with this one-line change applied locally, both tests pass.
Side effect to handle in the PR: the .bloggingPrompt case in handleLocalNotificationAction tracks bloggingRemindersNotificationReceived at the top for every response. Once dismissals arrive, each dismissal will also log that event. Either move that tracking so it skips dismissals, or keep it and say so in the PR.
How to verify on a device
- Both tests pass.
- Turn on blogging prompts, then wait for a prompt reminder (or schedule one for a minute ahead).
- Swipe it away in Notification Center without opening it.
-
blogging_reminders_notification_prompt_dismissedappears in the debug analytics log.
Not checked on a device or simulator yet.
- Lenguaje dominante
- Swift
- Estrellas
- 3.9k
- Forks
- 1.2k
- Merge medio
- 2 d 3 h
- PR fusionados (30 d)
- 97
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de wordpress-mobile/WordPress-iOS
-
[Pri] Low [Status] Ready for Dev [Type] Bug /Me
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
wordpress-mobile/WordPress-iOS#26279 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[Pri] Low [Status] Ready for Dev [Type] Bug Share Extension
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
wordpress-mobile/WordPress-iOS#26276 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[Status] Ready for Dev [Type] Bug Reader
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
wordpress-mobile/WordPress-iOS#26254 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
[Type] Bug Posts + Pages UI
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
wordpress-mobile/WordPress-iOS#26232 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[Type] Tech Debt Site Creation
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
wordpress-mobile/WordPress-iOS#26113 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de wordpress-mobile/WordPress-iOS
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
vorssaint/vorssaint-utils#3667 ·
Los mantenedores suelen responder en 1 día
-
area: browser
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
manaflow-ai/cmux#27619 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
dkhamsing/open-source-ios-apps#2484 · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
matteocrippa/awesome-swift#2028 ·
Los mantenedores suelen responder en 3 días
-
documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Los mantenedores suelen responder en 1 día