Remove spreadsheet caching, externalize AUTH_KEY, and enhanced batch processing#1400
Remove spreadsheet caching, externalize AUTH_KEY, and enhanced batch processing#1400matikhi wants to merge 8 commits into
Conversation
Remove the spreadsheet caching layer that was creating performance bottlenecks and quota consumption. This simplifies the codebase and eliminates unnecessary I/O latency from cache reads/writes. Issues addressed: - Excessive quota consumption from spreadsheet operations - Added latency from cache lookups and writes - Complexity in cache invalidation logic BREAKING CHANGE: The optional caching mechanism has been removed. Applications relying on the caching parameter should implement their own caching layer or discard cacheing.
Move AUTH_KEY from hardcoded value to PropertiesService.getScriptProperties() to prevent accidental credential exposure in source control and reduce security risk. - Store sensitive AUTH_KEY in script properties instead of codebase - Updated implementation comments to guide users on setup - Eliminates risk of unintended credential sharing via version control BREAKING CHANGE: AUTH_KEY must now be configured via script properties. Users have to: 1. Open Project Settings > Script Properties 2. Add key-value pair: AUTH_KEY = <your_key_value>
…challenges Fix issue where exit_node was rendering raw JSON responses in browsers instead of properly handling responses. Replace all var declarations with let for consistency. Fix wrong property of ContentService.MimeType (HTML->XML) - In order to pass Cloudflare anti-bot challenges ,Users have to add "challenges.cloudflare.com" to hosts configuration in client app - DenoDeploy passes Cloudflare tests successfully
…zed logic - Replace Array with Set for O(1) lookups - Optimize single-item fetch to avoid fetchAll
- Rename function and arguments for clarity - Extract duplicated logic into helper function - Add safety checks throughout codebase
Split requests into batches of 50 items to prevent hitting Google Apps Script fetchAll method limitations. - Add batching logic using Map structure to avoid lists index syncronization overhead - Refactor _doBatch core logic for batch processing - Add helper function for batch handling
|
Thanks for the work here. I am not going to merge this as-is because it changes a very sensitive setup contract for existing users. The risky part is externalizing I would be open to this split into smaller/non-breaking pieces:
Also please avoid bundling the Cloudflare-challenge host guidance into the same PR unless the client-side config/docs change is included too. That part needs its own review because it affects routing expectations. Answered via LLM, Supervised @therealaleph |
|
سلام، در مورد تغییری که برای کاربران فعلی ایجاد مشکل کنه، یعنی auth key فقط دو خط اول تغییرات رو صرف کنید و حالت قبلی رو نگهدارید کافیه. |
|
سلام، ممنون بابت توضیح. من دوباره head فعلی PR را چک کردم. از نظر syntax این پاس شد: اما هنوز نمیتوانم merge کنم، چون نسخه فعلی هنوز const AUTH_KEY = PROPERTIES.getProperty("AUTH_KEY");و بخش deployment هم فقط مسیر Script Properties را توضیح میدهد. یعنی مسیر فعلی کاربران که فایل را paste میکنند و همان اگر همانطور که گفتید فقط دو خط لازم است، لطفاً همین را داخل خود PR push کنید: حالت جدید const AUTH_KEY_FALLBACK = "CHANGE_ME_TO_A_STRONG_SECRET";
const AUTH_KEY = PROPERTIES.getProperty("AUTH_KEY") || AUTH_KEY_FALLBACK;بعد هم اگر هر دو حالت missing/placeholder بودند، error واضح بدهد. Deployment docs داخل بالای
تغییرات batch processing را میشود بعد از این بررسی کرد، ولی تا وقتی PR یک breaking setup change دارد، نمیخواهم آن را با بهینهسازیها قاطی و merge کنم. اگر راحتتر است، بهترین مسیر این است که auth را non-breaking کنید یا PR را به یک PR performance-only کوچکتر split کنید. Answered via LLM, Supervised @therealaleph |
توضیحات
این PR شامل بهبودهای عمدهای در کارایی، امنیت و پایداری کد است:
تغییرات اصلی
PropertiesServiceاستفاده شدتغییرات Breaking
AUTH_KEYباید در Script Properties تنظیم شود"challenges.cloudflare.com"باید به hosts config اضافه شودجزئیات فنی