solutions/automations/vacation-calendar/ fails to import events that are created too far in advance
@vinay-google がすでに取り組んでいます。
2024年7月10日 から。
評価
この issue はまだ評価されていません。
説明
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.
- 主要言語
- JavaScript
- スター
- 5.2k
- フォーク
- 2k
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
googleworkspace/apps-script-samples のほかの issue
-
Alvin Litana Mirasol オープン
難易度 5/5 1週間以上 初心者へのやさしさ 1/100
googleworkspace/apps-script-samples#659 · コメント 1 件 · リアクション 1 件 ·
-
Password reset オープン
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
googleworkspace/apps-script-samples#654 · リアクション 2 件 ·
-
cod gs オープン
難易度 5/5 1週間以上 初心者へのやさしさ 10/100
googleworkspace/apps-script-samples#651 · リアクション 1 件 ·
-
tespogrome オープン
難易度 5/5 1週間以上 初心者へのやさしさ 1/100
googleworkspace/apps-script-samples#624 · リアクション 1 件 ·
-
googleworkspace/apps-script-samples#616 · 担当者 1 名 ·
googleworkspace/apps-script-samples の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
mksglu/context-mode#1200 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
neondatabase/website#5944 ·
-
module: core
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
bigbluebutton/bigbluebutton#25849 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
jaegertracing/jaeger-ui#4506 ·