Searching also returns full-day events of adjacent days
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
Línea de trabajo
Start by reproducing the reported cases with the supplied calendar.search(start=..., end=..., event=True, expand=True) calls, then read the implementation and documentation for search() and its handling of full-day events and timezones. Done means searches return the expected events for the reported dates and timezone variants; clarify the intended CalDAV behavior before choosing a fix.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem:
I'm trying to find all events that occur today or later. In some cases, events from yesterday are returned.
I'm not completely sure if this is a bug or just the way CalDAV works, but at least it's not what I expected.
Test setup: There are there are three full-day events in the calendar, on 18.,19.,20.08.25. I created them with Thunderbird, the server is Baikal. I did not specify a timezone (nor could I for full-day events).
Code:
from datetime import datetime, timedelta, date, timezone
import caldav
url = "..."
username = "..."
password = "..."
client = caldav.DAVClient(url, username=username, password=password)
principal = client.principal()
calendars = principal.calendars()
calendar = next(cal for cal in calendars if cal.name == "Test-Cal")
# there are three full-day events in the calendar, on 18.,19.,20.08.25
dates = [
datetime(year=2025, month=8, day=17, hour=0, minute=10),
datetime(year=2025, month=8, day=17, hour=0, minute=10, tzinfo=timezone(timedelta(hours=2))),
datetime(year=2025, month=8, day=17, hour=0, minute=10, tzinfo=timezone(timedelta(hours=0))),
datetime(year=2025, month=8, day=17, hour=0, minute=0),
datetime(year=2025, month=8, day=17, hour=0, minute=0, tzinfo=timezone(timedelta(hours=2))),
datetime(year=2025, month=8, day=17, hour=0, minute=0, tzinfo=timezone(timedelta(hours=0))),
]
for test_time in dates:
print("Testing with", test_time)
print(" | 18 | 19 | 20 |")
for i in range(4):
print(f" +{i} |", end="")
t = test_time + timedelta(days=i)
results = calendar.search(start=t, end=t + timedelta(days=1), event=True, expand=True, sort_keys="dtstart")
summaries = [e.instance.vevent.summary.value for e in results]
for j in range(1, 4):
if f"Test{j}" in summaries:
print(f" X |", end="")
else:
print(f" |", end="")
print()
Output (with comments from me). Expected would be a diagonal in the last three lines.
Testing with 2025-08-17 00:10:00 //my actual code, running in UTC+2 just after midnight
| 18 | 19 | 20 |
+0 | | | |
+1 | X | | |
+2 | X | X | | //the bug I noticed
+3 | | X | X |
Testing with 2025-08-17 00:10:00+02:00 //add the timezone explicitly
| 18 | 19 | 20 |
+0 | | | |
+1 | X | | |
+2 | X | X | | //no change
+3 | | X | X |
Testing with 2025-08-17 00:10:00+00:00 //now in UTC
| 18 | 19 | 20 |
+0 | X | | | //this is correct b/c 00:10+1d contains the next day!
+1 | X | X | |
+2 | | X | X |
+3 | | | X |
Testing with 2025-08-17 00:00:00 // test on exactly midnight
| 18 | 19 | 20 |
+0 | | | |
+1 | X | | |
+2 | X | X | | //same problem
+3 | | X | X |
Testing with 2025-08-17 00:00:00+02:00
| 18 | 19 | 20 |
+0 | | | |
+1 | X | | |
+2 | X | X | | //dito
+3 | | X | X |
Testing with 2025-08-17 00:00:00+00:00 //midnight, UTC
| 18 | 19 | 20 |
+0 | | | |
+1 | X | | | //correct!
+2 | | X | |
+3 | | | X |
This is the pattern I could make up from this:
- without timezone infos, the datetime gets interpreted in the local timezone
- before matching against full-day events in the calendar, dates are shifted to UTC
- this causes the dates to move to the previous day
This is just my guesswork, someone with more insight to CalDAV can probably make more sense out of this.
- Lenguaje dominante
- Python
- Estrellas
- 412
- Forks
- 113
- Merge medio
- 1 d 6 h
- PR fusionados (30 d)
- 35
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin 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 python-caldav/caldav
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
python-caldav/caldav#687 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 Medio día Aptitud para principiantes 50/100
python-caldav/caldav#765 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
python-caldav/caldav#763 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
python-caldav/caldav#761 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
python-caldav/caldav#725 ·
Los mantenedores suelen responder en 1 día
Todos los issues de python-caldav/caldav
Issues similares
-
[Bug]: LangGraph Store sync put bypasses namespace validationPosiblemente ocupada @ktz03 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
volcengine/OpenViking#6050 ·
Los mantenedores suelen responder en 1 día
-
[Bug]: Streamed /v1/chat/completions sends unredacted agent error text (keys) in the final chunkPosiblemente ocupada @rodricksz4h5 la tomó hoy. Abiertoarea/streaming comp/gateway P2 type/security
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
NousResearch/hermes-agent#138245 ·
Los mantenedores suelen responder en 1 día
-
[oblt-aw][autodoc] Update user onboarding guide for mandatory trigger CODEOWNERS stepPosiblemente ocupada @github-actions la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Los mantenedores suelen responder en 1 día
-
correction metadata
Dificultad 2/5 Menos de una hora Aptitud para principiantes 68/100
acl-org/acl-anthology#10378 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
cloudtrail_multi_region_enabled_logging_management_events fails when the advanced event selector has a custom namePosiblemente ocupada @12YYCCYY16 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
prowler-cloud/prowler#13033 ·
Los mantenedores suelen responder en 1 día