solutions/automations/vacation-calendar/ fails to import events that are created too far in advance
@vinay-google đang làm issue này rồi.
Từ ngày 10/7/2024.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Summary
The code in solutions/automations/vacation-calendar/Code.js uses lastRun to constrain the event search, but only imports events that are timed between now and MONTHS_IN_ADVANCE months from now.
Hence, these events never get imported because when they satisfy the updatedMin parameter constraint in the Calendar.Events.list call, they fail the timeMin and timeMax constraint.
Expected Behavior
The code would import events, even events created a long time ago, if they occur within the search period (now, now+MONTHS_IN_ADVANCE).
Sample URL: https://github.com/googleworkspace/apps-script-samples/blob/main/solutions/automations/vacation-calendar/Code.js
Description:
Actual Behavior
The code only imports events if they were created within MONTHS_IN_ADVANCE of their occurrence. Other events are skipped entirely.
Steps to Reproduce the Problem
- Create a vacation event for a date 4 months from now.
- Let the script run.
- Notice that the event is not imported and is never imported.
Proposal
While the optSince parameter in findEvents is useful in further demonstrating the Calendar.Events.list API call, and generally reduces execution cost, it seems to prevent one important expected behavior for a team vacation populator---that events planned far in advance will show up in the team calendar. I suggest three alternatives:
- Remove the
updatedMinparameter in thefindEventsbody. That way, the code will still add upcoming events, but will add redundant events that get de-duplicated. - Set the default MONTHS_IN_ADVANCE relatively large, e.g., 12, 18 or more, so that the problem only manifests for events created much farther in advance.
- Add a warning comment in the code that alerts the developer to the nature of these skipped imports and let the developer implement solution if desired.
- Ngôn ngữ chính
- JavaScript
- Star
- 5.2k
- Fork
- 2k
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
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 googleworkspace/apps-script-samples
-
Alvin Litana Mirasol Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 1/100
googleworkspace/apps-script-samples#659 · 1 bình luận · 1 reaction ·
-
Password reset Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
googleworkspace/apps-script-samples#654 · 2 reaction ·
-
cod gs Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 10/100
googleworkspace/apps-script-samples#651 · 1 reaction ·
-
tespogrome Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 1/100
googleworkspace/apps-script-samples#624 · 1 reaction ·
-
Get_order_manually.gs Đang mở
googleworkspace/apps-script-samples#616 · 1 người được giao ·
Tất cả issue của googleworkspace/apps-script-samples
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
area-deployment area-integrations triage:bot-seen
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 86/100
-
Issue-Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
sugarlabs/musicblocks#8924 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
ArduPilot/ardupilot_wiki#8088 ·
-
[BUG] createTool tools cannot be registered with Mastra when exactOptionalPropertyTypes is enabled Đang mởcustomer-eng status: needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100