Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Blogging prompt notifications never report dismissals

Abierto Apto para principiantes
#26,256 1 comentario 0 reacciones 0 asignados Ver en GitHub

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
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
ios, swift
Área
analytics, mobile

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

[Pri] Low [Status] Ready for Dev [Type] Bug Blogging Prompts Notifications

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.notificationCategoryOptions returns [.customDismissAction] for .bloggingPrompt.
  • notificationCategory() never uses it. It always passes empty options: options: UNNotificationCategoryOptions().
  • So iOS never reports a dismissal. The UNNotificationDismissActionIdentifier branch in handleLocalNotificationAction, which tracks promptsNotificationDismissed, 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_dismissed appears 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

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de wordpress-mobile/WordPress-iOS

Todos los issues de wordpress-mobile/WordPress-iOS

Issues similares

Más issues de Swift

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.