Skip to content
📦 ARCHIVED SNAPSHOT (v1.0) You are viewing historical business logic and documentation for Microservices (PHP) v1.0 (frozen on 2026-11-23, commit 96144c89). Switch to Latest →

Open Questions [TEAM_WHY_NEEDED] & Tech Debt

Use this board during engineering/product reviews to record the historical “Why?” behind non-obvious rules and track cleanup priorities.

A. Open [TEAM_WHY_NEEDED] Questions

  1. [TEAM_WHY_NEEDED: Why does scheduler/backend/api.php return HTTP 200 with full API_DEBUG_TRACE on every request including errors and fatal crashes, instead of proper 4xx/5xx codes and server-side logging?]
  2. [TEAM_WHY_NEEDED: Why are Google Calendar event creation failures silently swallowed (scheduler/backend/api.php:571-573) after reserving the DB row, leaving a booking with no Meet link and no user/host warning?]
  3. [TEAM_WHY_NEEDED: Why do scheduler/backend/delete_json.php and dealflow/backend/delete_json.php require no authentication header unlike save_scheduler.php and save_dealflow.php?]
  4. [TEAM_WHY_NEEDED: Why is scheduler/data/.htaccess missing from git even though scheduler/backend/public_config.php:6 states "The data/ folder itself is now blocked by data/.htaccess"?]
  5. [TEAM_WHY_NEEDED: Why do both dealflow/api/create_offer.php (generates random offer_ ID, returns 201) and dealflow/api/save_dealflow.php (accepts caller-supplied id, returns 200) coexist — are both still called by planovi-flutter-app?]
  6. [TEAM_WHY_NEEDED: Why is Turnstile omitted in Pricing Mode (dealflow/offer.php:1805, 1900) and skipped in dealflow/api/save_response.php:47 whenever turnstile_token is empty?]
  7. [TEAM_WHY_NEEDED: Why is dealflow/test_generator.php deployed without an environment or auth guard, allowing anyone to write files into dealflow/data/?]
  8. [TEAM_WHY_NEEDED: Does Supabase Storage bucket company-media restrict anon uploads to {company_id}/signatures/* via RLS tied to an active session, or can any caller with SUPABASE_ANON_KEY overwrite signature PNGs?]
  9. [TEAM_WHY_NEEDED: Confirm mode='admin_edit' and deal_id are mutually exclusive in planovi-backend tokens, since offer.php:141-150 lets deal_id override submitFnUrl while keeping IS_ADMIN_EDIT payload format.]
  10. [TEAM_WHY_NEEDED: Why is $appUrl hardcoded to 'https://dev-panel.planovi.app' in dealflow/payment-success.php:20 instead of being env-configured?]
  11. [TEAM_WHY_NEEDED: Are both dealflow/inquiry-success.php and dealflow/payment-success.php actively used as Stripe success_url targets in planovi-backend, or did one replace the other?]
  12. [TEAM_WHY_NEEDED: Why does dealflow/inquiry.php have no Cloudflare Turnstile or rate limiting before calling the public submit-inquiry Edge Function?]
  13. [TEAM_WHY_NEEDED: Why do identical copies exist at both agreements/sign.php and dealflow/sign.php? Which path is canonical in production emails?]
  14. [TEAM_WHY_NEEDED: Should #docFrame in agreements/sign.php use an iframe sandbox attribute when rendering htmlContent via srcdoc?]
  15. [TEAM_WHY_NEEDED: Does the "24 godziny" expiry text in the GoTrue auth email templates match the actual GOTRUE_MAILER_OTP_EXP value configured on VPS?]
  16. [TEAM_WHY_NEEDED: What is the status and timeline of the Laravel 11 migration (laravel-app/ contains only .env.example)? Should branding/security fixes go into the plain PHP microservices first?]
  17. [TEAM_WHY_NEEDED: Why does README.md reference an offers/ microservice and Python runtime when neither exists in this repository?]

B. Critical Security Anomalies (Actionable)

  • Hardcoded Google OAuth Credentials & Dev Redirect URI: scheduler/backend/config_google.php:5-7 hardcodes GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, and https://dev-scheduler.planovi.app/backend/auth_callback.php in git. Rotate credentials and load from .env.
  • Committed GCP OAuth Reference JSON: scheduler/backend/gcp_clientId_clientSecret(not used, just for reference).json is tracked in git. Remove from repo and scrub history.
  • Live OAuth Tokens Committed in Git + Missing .htaccess: 34 files across scheduler/data/*.json and scheduler/backend/data/*.json contain non-empty google_access_token / google_refresh_token values committed to git, and scheduler/data/.htaccess is missing from git. Revoke/rotate tokens, add scheduler/data/.htaccess (Require all denied), and gitignore runtime data/*.json and *.log/*.txt.
  • Hardcoded Fallback Turnstile Secret + Bypassable Check: dealflow/api/save_response.php:45 has a hardcoded fallback string for TURNSTILE_SECRET_KEY, and line 47 skips verification completely if turnstile_token is omitted.
  • Unauthenticated File Deletion Endpoints: dealflow/backend/delete_json.php and scheduler/backend/delete_json.php accept unauthenticated POST {"id":"..."} from Access-Control-Allow-Origin: * and unlink arbitrary JSON files in data/.
  • Client-Spoofable company_id in Lead Submission: dealflow/api/save_response.php:70 trusts $new_response['company_id'] from the untrusted browser payload while inserting via SUPABASE_SERVICE_KEY (bypassing RLS), instead of reading company_id from dealflow/data/{offer_id}.json.
  • OAuth Login CSRF on Google Calendar Connect: scheduler/backend/auth_start.php:15 and auth_callback.php:21 use raw $client_id as OAuth state without a signed/session nonce, allowing an attacker to bind their Google account to another tenant’s scheduler ID.
  • Information Disclosure in API Responses: scheduler/backend/api.php leaks full API_DEBUG_TRACE (internal server file paths, Google FreeBusy timestamps, Supabase error bodies) in every public response; dealflow/api/save_response.php:121 returns raw Supabase error text in debug.
  • Timing-Unsafe Secret Checks: save_scheduler.php:100, save_dealflow.php:104, and create_offer.php:61 use !== instead of hash_equals().
  • Client-Side Self-XSS in Inquiry Summary: dealflow/inquiry.php:836-849 injects unescaped form values into innerHTML.
  • Unauthenticated File-Writing Dev Script: dealflow/test_generator.php writes 3 JSON files to dealflow/data/ on every GET request.

C. Verified Bugs & Code Discrepancies

  • Broken Tenant Logo in Offer Mode (dealflow/offer.php:945): Checks undefined $branding['logo_url'] instead of $offer_data['branding']['logo_url']; tenant logos never render in Offer Mode.
  • Duplicate Config Fetch & Duplicate MutationObserver in Scheduler: Both inline JS in scheduler/index.php:1111, 1190-1407 and scheduler/assets/script_v2.js:469, 556-770 independently fetch public_config.php, define generateCustomFields(), and attach MutationObservers to #form-view.
  • Broken file Custom Field in Scheduler (script_v2.js:410, 713-719): Renders <input type="file">, but JSON-encodes FormData.get() into custom_fields, serializing File objects as {}.
  • Missing LOCK_EX on Token Refresh Write (scheduler/backend/api.php:199): Concurrent visitors refreshing an expired Google access token can race on file_put_contents($jsonPath, ...) and corrupt the JSON file.
  • Header Logo Duplication in Signing Portal (agreements/sign.php:445-453): Prepends companyLogo <img> without hiding the default #brandIcon SVG; unused #brandImg element exists at line 241.
  • Domain Typos (planowi.app with w): Present in agreements/sign.php:345,348,350, dealflow/sign.php:345,348,350, dealflow/payment-success.php:262, and localStorage key 'planowi_theme' (sign.php:366,369).
  • Quote-Unsafe .env Loaders: agreements/sign.php, dealflow/sign.php, dealflow/inquiry.php, dealflow/inquiry-success.php, and dealflow/payment-success.php do not strip surrounding quotes from .env values.
  • Hardcoded Dev Legal Links & Cookie Banner Path: Footers across scheduler/index.php, dealflow/inquiry.php, dealflow/inquiry-success.php, dealflow/payment-success.php, and sign.php point to https://dev-main.planovi.app/assets/for_preview/index; both cookie-banner.php files link to non-existent relative path /assets/for_preview/index.php.
  • Complete Branding Migration Pending: All Zone 1 (GoTrue emails, inquiry/payment pages) and Zone 2 (scheduler, offer, sign) views still use legacy #0F172A/#14B8A6/#2DD4BF tokens and linear luminance > 0.5 instead of BRANDING_GUIDE.md (#09090B/#32CA42 and sRGB > 0.42).

D. Dead, Duplicate & Orphan Files

  • scheduler/default.php — Unused Hostinger welcome placeholder page.
  • dealflow/sign.php — Byte-for-byte duplicate of agreements/sign.php.
  • dealflow/cookie-banner.php & scheduler/cookie-banner.php — Duplicate partials (whitespace-only diff).
  • dealflow/api/data/deal_1771006118990.json & scheduler/backend/data/*.json (2 files) — Orphan JSON files inside wrong nested data/ folders never read by current endpoints.
  • scheduler/backend/api_debug.log (3,041 lines), scheduler/backend/delete_log.txt (55 lines), dealflow/backend/delete_log.txt (9 lines) — Runtime log files tracked in git.
  • dealflow/data/*.json (71 files) & scheduler/data/*.json (75 files) — Runtime/dev data files tracked in git.
  • .github/ — Empty directory left after commit d3db7aba.
  • config.php — Included only by scheduler/index.php, with none of its URL constants (BASE_URL, SCHEDULER_URL, DEALFLOW_URL, ASSETS_URL, etc.) referenced anywhere in the repo.