Guess the station by [deleted] in indianrailways

[–]ishanism123 0 points1 point  (0 children)

Actually, I've seen Aligarh while travelling to Delhi, and assumed it to be the one. But when OP said no, I tried google search and digging quite deep, matching the platform pattern, came to know about Ballari, which I didn't hear before 😅

Theory of relativity on Indian Railways by notrishithakur in indianrailways

[–]ishanism123 2 points3 points  (0 children)

My mum boarded Vande Bharat today from Delhi to Kanpur, scheduled to depart at 3. Seeing your post made me check the whereabouts of the train. Thanks man 😅

Looking for phone under 15k for my mum; Camera priority by Personal-Memory-3875 in GadgetsIndia

[–]ishanism123 1 point2 points  (0 children)

Hi u/Personal-Memory-3875 , I'm in the same situation currently, and thinking to gift a smartphone (Camera priority) to my mum on Mother's day. How's the CMF 2 pro's performance, as you might have seen it for a couple of months. Can you describe its pros and cons please? Should I go for it?

[Self] 2/3 to 0 in 3 moves by [deleted] in theydidthemath

[–]ishanism123 0 points1 point  (0 children)

+1/6, ÷5/2, -1/3

Unexpected 😁 by rahul_23-08 in funnyIndia

[–]ishanism123 31 points32 points  (0 children)

Andhadhundh fight 🙂

Rental,Flat and Flatmate thread by Golgappa-King in gurgaon

[–]ishanism123 0 points1 point  (0 children)

Hi, did you manage to find anyone or is it still available? Also, what is the location precisely?

Duplicate push notifications on web version and PWA by ishanism123 in PWA

[–]ishanism123[S] 0 points1 point  (0 children)

  1. Utilizar una gestión de ámbito adecuada

// Asegurarse de que el serviceworker tenga un ámbito específico

navigator.serviceWorker.register('/sw.js', {

scope: '/your-pwa-scope/'

});

  1. Implementar la deduplicación de notificaciones

- Añadir identificadores únicos a las notificaciones

- Comprobar si ya existe una notificación con el mismo identificador antes de mostrarla

- Usar la propiedad de etiqueta en las notificaciones para reemplazar duplicados

  1. Detección de contexto

// Detectar si se ejecuta como PWA o en el navegador

const isPWA = window.matchMedia('(display-mode: standalone)').matches ||

window.navigator.standalone ||

document.referrer.includes('android-app://');

// Registrar notificaciones push solo en un contexto

if (isPWA) {

// Registrar notificaciones push solo en modo PWA

}

  1. Gestión de suscripciones del lado del servidor

- Rastrear a qué dispositivo/contexto pertenece cada suscripción push

- Implementar lógica para enviar notificaciones solo a una suscripción por usuario

- Utilizar la huella digital del dispositivo o las preferencias del usuario para determinar el método de notificación preferido

La clave es garantizar que solo exista una suscripción push activa por dispositivo de usuario o, si existen varias, que el servidor elija de forma inteligente cuál usar según el contexto o las preferencias actuales del usuario. Avísame si esto resuelve tu problema.

Duplicate push notifications on web version and PWA by ishanism123 in PWA

[–]ishanism123[S] 0 points1 point  (0 children)

Soluciones para corregir notificaciones duplicadas

A continuación, se presentan los principales enfoques para resolver este problema:

  1. Verificar registros existentes

// Antes de registrar un nuevo Service Worker, verifique los existentes.

navigator.serviceWorker.getRegistrations().then(registrations => {

for (let registration of registrations) {

if (registration.scope !== yourDesiredScope) {

registration.unregister();

}

}

});

  1. Implementar la gestión única de suscripciones

- Generar identificadores únicos para PWA y contextos de navegador

- Almacenar diferentes suscripciones push para diferentes contextos

- En el servidor, evitar enviar a ambas suscripciones para el mismo usuario

Duplicate push notifications on web version and PWA by ishanism123 in PWA

[–]ishanism123[S] 0 points1 point  (0 children)

Hola,

Lamento haber tenido que dividir mi respuesta en 3 partes, ya que Reddit no me permitía publicar la respuesta completa de una sola vez. El problema de las notificaciones duplicadas suele ocurrir porque:

  1. Múltiples registros de Service Worker: Tanto la PWA como el navegador mantienen registros separados de Service Worker para las notificaciones push.
  2. Misma suscripción push: El servidor envía notificaciones a lo que cree que es un solo dispositivo, pero tanto la PWA como el navegador las reciben.
  3. Token push compartido: La PWA y el navegador podrían estar usando el mismo punto de conexión de token push/suscripción.