HelloZeroNet / HelloZeroNet/ZeroNet

Updates of cert-based content.json's may be lost

Đang mở
#2,476 5 bình luận 0 reaction 0 người được giao Xem trên GitHub
enhancement
Ngôn ngữ chính
JavaScript
Star
18.8k
Fork
2.3k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

ZeroNet version: rev 4462, from the official docker image

### Describe the problem:

On a long-running ZeroNet instance, that periodically goes offline for long time intervals as well, I noticed, that some sites miss the content available on several fresh ZeroNet instances.

I've looked through the source code, and as far as I could understand, here is the place where we prefer to save the network traffic and time at the risk of getting an incomplete update:

```
if since is None: # No since defined, download from last modification time-1day
since = self.settings.get("modified", 60 * 60 * 24) - 60 * 60 * 24
```

So, looks like we actually get incomplete updates. On long-running instances, those incomplete updates tend to accumulate, and the user silently misses an undetermined amount of the cert-based data, such as forum posts, comments, likes etc.

#### Steps to reproduce:

Command: `zeroframe.cmd("siteUpdate", ["1TaLkFrMwvbNsooF4ioKAY9EuxTBTjipT"])`
Result: no files to update

Command: `zeroframe.cmd("siteUpdate", ["1TaLkFrMwvbNsooF4ioKAY9EuxTBTjipT", false, 0])`
Result: "Updating: 70 left"

Command: `zeroframe.cmd("siteUpdate", ["1Apr5ba6u9Nz6eFASmFrefGvyBKkM76QgE"])`
Result: no files to update

Command: `zeroframe.cmd("siteUpdate", ["1Apr5ba6u9Nz6eFASmFrefGvyBKkM76QgE", false, 0])`
Result: "Updating: 160 left"

Command: `zeroframe.cmd("siteUpdate", ["1SunAWK2VUT9GQK32MpwRfFPVgcBSJN9a"])`
Result: no files to update

Command: `zeroframe.cmd("siteUpdate", ["1SunAWK2VUT9GQK32MpwRfFPVgcBSJN9a", false, 0])`
Result: "Updating: 70 left"

And so on.

Currently, I found no way to force the core to make the full update from UI.

* ZeroHello -> site -> Update doesn't work. (Fetches no missing files.)
* ZeroHello -> site -> Check files doesn't work either.

The only way to force the full update is to run `zeroframe.cmd("siteUpdate", ["address", false, 0])` from the browser console.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

Start at the siteUpdate entry point invoked through zeroframe.cmd and inspect the since calculation using the modified setting. Reproduce the difference between the default update and the explicit false, 0 call, then verify that ordinary updates no longer miss cert-based content and that the UI offers an equivalent full-update path.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
python
Lĩnh vực
distributed-systems
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.