[Bug]: Webcal import drops VCALENDAR refresh interval properties

未关闭
#66,497 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
60/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
php
领域
backend

调研方向

Start in apps/dav/lib/CalDAV/Import/TextImporter.php at analyze(), where calendar-level properties are written to an undefined local $components instead of $this->structure, then follow the VCALENDAR loop in ImportService::importText(). Check how RefreshWebcalService::updateRefreshRate() reads REFRESH-INTERVAL and X-PUBLISHED-TTL from the reconstructed object, and how RefreshWebcalJob falls back to the default. Done means the synthetic feed's PT1H is stored as the subscription refreshrate, and a regression test covers the VEVENT import and the refresh-rate update.

由索引模型根据 Issue 内容生成。

描述

35-feedback
⚠️ This issue respects the following points
  • This is not a troubleshooting question, general support matter, or webserver/proxy problem, but likely a bug.
  • This issue is not already reported on GitHub or solved at the Community Help Forum (searched for TextImporter, REFRESH-INTERVAL, X-PUBLISHED-TTL, and calendarSubscriptionRefreshRate).
  • I am using a maintained major version and reproduced this on the latest patch level, Nextcloud 35.0.2.
  • I agree to follow Nextcloud's Code of Conduct.
  • The reproduction below uses only synthetic calendar data.
Bug description

Nextcloud 35.0.2 successfully downloads and imports VEVENT objects from a Webcal subscription, but calendar-level refresh properties are lost while the text feed is split into individual VCALENDAR objects.

As a result, RefreshWebcalService::updateRefreshRate() cannot see either:

REFRESH-INTERVAL;VALUE=DURATION:PT1H
X-PUBLISHED-TTL:PT1H

The subscription's refreshrate remains empty and RefreshWebcalJob falls back to the app-wide default, which is P1D. Events import correctly when the job runs, but a feed advertising an hourly refresh can therefore be refreshed only once per day.

The behavior is visible in the current stable35 and master source:

  1. TextImporter::analyze() writes calendar-level properties to a local, undefined $components variable instead of $this->structure:
$components['VCALENDAR'][] = $data;
  1. Even if $structure['VCALENDAR'] were populated, ImportService::importText() does not append $entry to $sObjectPrefix; it only conditionally appends a line ending:
foreach ($structure['VCALENDAR'] as $entry) {
    if (!str_ends_with($entry, "\n") || !str_ends_with($entry, "\r\n")) {
        $sObjectPrefix .= PHP_EOL;
    }
}
  1. RefreshWebcalService::updateRefreshRate() reads the refresh properties from the last reconstructed per-object VCALENDAR. Those reconstructed objects no longer contain the original calendar-level properties.
Steps to reproduce
  1. Serve the following synthetic calendar over HTTPS:
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Example//Webcal Refresh Test//EN
CALSCALE:GREGORIAN
REFRESH-INTERVAL;VALUE=DURATION:PT1H
X-PUBLISHED-TTL:PT1H
BEGIN:VEVENT
UID:[email protected]
DTSTAMP:20261109T120000Z
DTSTART:20261110T100000Z
DTEND:20261110T110000Z
SUMMARY:Webcal refresh test
END:VEVENT
END:VCALENDAR
  1. Add the URL as a new subscribed calendar in Nextcloud Calendar.
  2. Run system cron, or execute the matching OCA\DAV\BackgroundJob\RefreshWebcalJob.
  3. Confirm that the VEVENT is imported successfully.
  4. Inspect the subscription refresh property, for example read-only in oc_calendarsubscriptions.refreshrate.
  5. Observe that refreshrate is still empty.
  6. Observe that subsequent scheduling uses the default calendarSubscriptionRefreshRate=P1D, not the feed's PT1H.

A direct fetch of the same URL returns HTTP 200 and both refresh properties. Passing the response stream through ImportService::importText() yields the expected VEVENT, but the generated per-event VCALENDAR does not retain the refresh properties.

Expected behavior

Calendar-level properties needed by the Webcal refresh path should survive text import splitting. After the first successful refresh, the subscription should store PT1H, and RefreshWebcalJob should use that feed-provided interval.

A regression test should cover at least:

  • preservation of REFRESH-INTERVAL;VALUE=DURATION:PT1H;
  • preservation/fallback handling of X-PUBLISHED-TTL:PT1H;
  • successful VEVENT import;
  • updating the subscription refresh rate from the reconstructed object.
Nextcloud Server version

35.0.2

Operating system

Debian/Ubuntu (official Apache container image)

PHP engine version

PHP 8.5

Web server

Apache (supported)

Database engine version

MariaDB

Is this bug present after an update or on a fresh install?

Observed after a major-version upgrade to Nextcloud 35. The affected import code is independent of migrated application data and is reproducible with a newly created subscription.

Are you using the Nextcloud Server Encryption module?

Encryption is disabled.

What user-backends are you using?
  • Default user-backend (database)
Configuration report

Only the relevant DAV value is shown; no secrets or deployment-specific configuration are included:

{
  "apps": {
    "dav": {
      "calendarSubscriptionRefreshRate": "P1D"
    }
  }
}

Setting calendarSubscriptionRefreshRate=PT1H is an effective global workaround, but it applies to every subscription and should not be required when a feed provides its own valid interval.

List of activated Apps

Not relevant to the minimal reproduction. The issue occurs in the server DAV Webcal import path.

Nextcloud Signing status

No code-integrity failures.

Nextcloud Logs

No network or parsing error is required to reproduce the issue. The HTTP request succeeds and VEVENT objects are imported.

Additional information

Affected source as of 2026-11-09:

  • stable35 head inspected: b3adc84c0bfa409437f1cc76dc89c567e97b7172
  • apps/dav/lib/CalDAV/Import/TextImporter.php
  • apps/dav/lib/CalDAV/Import/ImportService.php
  • apps/dav/lib/CalDAV/WebcalCaching/RefreshWebcalService.php
  • apps/dav/lib/BackgroundJob/RefreshWebcalJob.php

The same relevant code is currently present in master.

主要语言
PHP
星标
37.5k
派生
5.4k
平均合并
1 天 13 小时
30 天内合并 PR
639

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

nextcloud/server 的其他 Issue

查看 nextcloud/server 的全部 Issue

相似的 Issue

更多 PHP Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。