Linked spreadsheet: Never overwrite existing data
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript
- Lĩnh vực
- backend
Hướng nghiên cứu
Bắt đầu bằng cách xem xét PR #1758 và lần theo quy trình ghi vào bảng tính mà PR này đã giới thiệu. Xác nhận cách các phản hồi mới chọn một hàng và cách các cập nhật bảng tính được lưu bền vững, sau đó xác định phạm vi bao phủ để giữ nguyên nội dung hiện có và ngăn các lần gửi đồng thời làm mất các mục nhập. Hoàn tất có nghĩa là các phản hồi mới được thêm vào mà không ghi đè các hàng hoặc chỉnh sửa trước đó.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I previously posted this as feedback on the PR before it was applied (https://github.com/nextcloud/forms/pull/1758#issuecomment-1896763727), but since it was out of scope for the initial PR, I'm reposting this here.
Nextcloud:
- Nextcloud-Version: 28.0.1
- Forms-Version: 4.0.0 with PR #1758 applied
Is your feature request related to a problem? Please describe.
Usecase
The usecase I want to implement is a logbook for work on the electrical installation in a building. We currently have a spreadsheet in Nextcloud with a line for each change made, with some details about what, where, who, when, etc. To lower the bar for people to enter something in the logbook (and importantly, to allow unauthenticated users to add but not edit entries), I want to use a public form that adds entries to this logbook (and then put up QR-codes in the electrical cabinets so people can find the form).
Overwriting data
Currently every time a new answer is added, the field names and all previous answers are also written to the spreadsheet (again). This means that I cannot:
- Manually add a row in the spreadsheet - it will be overwritten by the next form response
- Edit any form data in the spreadsheet (fix typo's, add extra info) - it will be reverted on the next form response
- Add extra rows above the table with some instructions for users of the spreadsheet
- Insert extra columns in between the result columns or reorder columns (adding extra columns to the right of the results works already).
The first three are problematic for my usecase - the reason I want to export to a spreadsheet is so I have the logbook in an easy to manage and edit form, and also so people that are more familiar with the tech can just add their entries directly in the spreadsheet. Problem 4 I added for completeness, fixing it would be nice but also easy to work around by adding extra data to the right if needed.
Describe the solution you'd like
Just add only values for the new entry on the first empty row in the spreadsheet, never modify any existing content. This also means that the header row with column names should be written only when the sheet is completely empty. This should fix problem 1-3 above, but leave problem 4 unfixed.
As a side effect, this does mean that if the form is modified to e.g. add extra questions, the column headers become outdated (and also old and new answers might put the same answer in different columns). Also, it leaves problem 4 unfixed. This could maybe be fixed by doing a column lookup first: When writing a new answer, look in the first row for the corresponding column name and write the answer into that column. If the column name is not found in the first row, write the column name to the first empty cell in the first row, and then write the answer in the same column. This would fix problem 4, but unfix problem 3 (since the column headers must now remain in the first row), unless we can somehow tell the forms app in what row the column headers live (using a configurable row offset, or maybe some magic tag value in the spreadsheet, not sure if that can be done invisibly to the user)?
Personally, I suspect that the extra complexity of fixing problem 4 is not worth the trouble, so it should be fine to fix just 1-3 and leave 4 unfixed. The most important part is that then existing data is never overwritten, so any weirdness in column layout will be visible to the user and they can just fix up things manually or adjust their workflow.
Challenges
One potential challenge with my proposed solution is that atomicity of writing data to the spreadsheet becomes more relevant. If each for submission only writes one entry, and two submissions happen at the same time, there might be (depending on implementation - I have not checked) a risk of one submission overwriting the previous one, dropping one entry. With the current code, where all entries are written, this risk is minimal (even if the first submission overwrites the data of the second submission, then a later third submission will write the second response again). This should probably be solved with some kind of locking to make sure that no changes are made to the spreadsheet between loading it from storage and writing the updated file.
- Ngôn ngữ chính
- JavaScript
- Star
- 384
- Fork
- 130
- Merge trung bình
- 17 giờ 5 phút
- Pull request đã merge (30 ngày)
- 83
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của nextcloud/forms
-
[Bug]: Forms: `"CustomMessage":"The filename fallback must only contain ASCII characters."}` errorĐang mở1. to develop bug upstream
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
nextcloud/forms#3684 · 6 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
0. Needs triage enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Maintainer thường phản hồi trong vòng 1 ngày
-
0. Needs triage enhancement needs info
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
nextcloud/forms#3733 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
0. Needs triage enhancement needs info
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
nextcloud/forms#3732 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
0. Needs triage enhancement
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 67/100
nextcloud/forms#3683 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của nextcloud/forms
Issue tương tự
-
area:install bug needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
yetone/magpie#2406 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG]: Prompt compressor crashes with TypeError when a past chat has a non-string response.textCó thể đã có người làm @ManojDevarajulu đã nhận hôm nay. Đang mởpossible bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Mintplex-Labs/anything-llm#6737 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add: Tooncast brazil feedĐang mởcheck:passed feeds:add
Độ khó 2/5 Dưới một giờ Mức phù hợp với người mới 62/100
-
Remove the dead tree 'loadfail' handler in browser.js, which calls a non-existent tree.isSelected()Đang mởHousekeeping
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
pgadmin-org/pgadmin4#10601 ·
Maintainer thường phản hồi trong vòng 1 ngày