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

RawDataState.get_uid() returns a VALARM's UID when it comes before the event's own UID

Abierto Apto para principiantes
#788 0 comentarios 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
68/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
python
Área
backend

Línea de trabajo

Empieza en caldav/datastate.py y compara RawDataState.get_uid() con el comportamiento descrito en la incidencia para el análisis completo y con el comportamiento de IcalendarState.get_uid(). Reproduce el ejemplo de UID con la alarma antes del evento y, después, revisa las pruebas existentes para la búsqueda de UID sin procesar. Se considera terminado cuando el acceso sin analizar devuelve event-1 en ese ejemplo y coincide con el acceso analizado.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Disclaimer: AI-generated text below the line, generated by Claude Opus 5.5, from the prompts:

Do a review of PR#787
[file the finding found]


RawDataState.get_uid() (caldav/datastate.py), the cheap accessor behind .id of an object that is not parsed yet, takes the first line matching ^UID: anywhere in the data. RFC 9074 section 4 allows a UID inside a VALARM, so if the VALARM comes before the event's own UID line, .id returns the alarm's UID:

BEGIN:VCALENDAR
BEGIN:VEVENT
BEGIN:VALARM
UID:alarm-1
ACTION:DISPLAY
TRIGGER:-PT5M
END:VALARM
UID:event-1
DTSTART:20260101T000000Z
END:VEVENT
END:VCALENDAR

RawDataState(data).get_uid() returns alarm-1. The full-parse fallback (DataState.get_uid()) and IcalendarState.get_uid() only look at VEVENT/VTODO/VJOURNAL/VFREEBUSY, and return event-1 — so .id changes once the object gets parsed.

The consequences are those fixed for folded UIDs in https://github.com/python-caldav/caldav/pull/787: get_object_by_uid() filters out the right object, save(no_overwrite=True) / save(no_create=True) check the wrong UID. Most clients write the UID before any VALARM, so this is likely rare in practice.

A possible fix: only accept a UID: line when no BEGIN:VALARM (or any other subcomponent) is open at that point, or fall back to the full parse whenever the data contains BEGIN:VALARM before the first UID:.

Lenguaje dominante
Python
Estrellas
412
Forks
113
Merge medio
11 h 37 min
PR fusionados (30 d)
50

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 python-caldav/caldav

Todos los issues de python-caldav/caldav

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.