Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion e2e/routes/_catalog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ export const PUBLIC_ROUTES: RouteEntry[] = [
{ path: `/approve/${SAMPLE_TOKEN}`, area: "public", feature: "quote-public-approval" },
{ path: `/proposta/${SAMPLE_TOKEN}`, area: "public", feature: "quote-public-proposal" },
{ path: `/kit/${SAMPLE_TOKEN}`, area: "public", feature: "kit-public" },
{ path: `/lista-publica/${SAMPLE_TOKEN}`, area: "public", feature: "favorites-public" },
{ path: `/colecao-publica/${SAMPLE_TOKEN}`, area: "public", feature: "collection-public" },
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep coverage until share UI is removed

When a seller uses the still-mounted favorites sharing dialog, src/components/favorites/ShareListDialog.tsx continues to generate /lista-publica/${list.shared_token} links, so removing this route from the public E2E catalog hides a user-visible broken sharing flow rather than cleaning it up. Either disable/remove that sharing UI and its token path at the same time, or keep the route covered so the regression remains visible.

Useful? React with 👍 / 👎.

{ path: `/comparar-publica/${SAMPLE_TOKEN}`, area: "public", feature: "comparison-public" },
Comment on lines 49 to 53
{ path: `/dossie/${SAMPLE_TOKEN}`, area: "public", feature: "dossier-public" },
Expand Down
8 changes: 0 additions & 8 deletions e2e/routes/public/lista-publica.spec.ts

This file was deleted.

2 changes: 1 addition & 1 deletion scripts/check-edge-structured-logging.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const LEGACY_ALLOWLIST = new Set([
"connections-health-check","connections-hub-audit","crm-db-bridge",
"detect-new-device","dropbox-list","e2e-cleanup","elevenlabs-scribe-token",
"elevenlabs-tts","expert-chat","external-db-bridge","external-db-inspect",
"favorites-public-react","favorites-watcher","force-global-logout",
"favorites-watcher","force-global-logout",
"full-op-diagnostics","generate-ad-image","generate-ad-prompt","generate-mockup",
"generate-mockup-nanobanana","generate-product-seo","get-visitor-info",
"github-credentials-test","health-check","image-proxy",
Expand Down
1 change: 0 additions & 1 deletion scripts/migrate-edge-cors-allowlist.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ const SKIP = new Set([
"quote-followup-reminders",
"process-queue",
"health-check",
"favorites-public-react",
"comparisons-public-react",
"collections-public-react",
"kit-public-view",
Expand Down
102 changes: 0 additions & 102 deletions src/hooks/useFavoriteReactions.ts

This file was deleted.

2 changes: 1 addition & 1 deletion supabase/config.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
project_id = "nmojwpihnslkssljowjh"
project_id = "doufsxqlfjyuvxuezpln"

[functions.crm-db-bridge]
verify_jwt = false
Expand Down
12 changes: 2 additions & 10 deletions supabase/functions/_shared/cors-snapshot.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"generated_at": "2026-05-01T20:17:13.993Z",
"total": 85,
"total": 83,
"counts": {
"shared": 85,
"shared": 83,
Comment on lines 1 to +5
"inline": 0,
"none": 0
},
Expand Down Expand Up @@ -247,14 +247,6 @@
"allowMethods": null,
"allowOrigin": null
},
{
"name": "favorites-public-react",
"mode": "shared",
"allowHeaders": [],
"exposeHeaders": [],
"allowMethods": null,
"allowOrigin": null
},
{
"name": "favorites-watcher",
"mode": "shared",
Expand Down
1 change: 0 additions & 1 deletion supabase/functions/_shared/edge-authz-manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export const EDGE_AUTHZ_MANIFEST: Record<string, AuthzEntry> = {
// ---------------- Públicas por design ----------------
"kit-public-view": { category: "public", rationale: "Visualização de kit por token público" },
"quote-public-view": { category: "public", rationale: "Aprovação de orçamento por token" },
"favorites-public-react": { category: "public", rationale: "Reactions anônimas em lista pública" },
"comparisons-public-react": { category: "public", rationale: "Reactions em comparação pública" },
"collections-public-react": { category: "public", rationale: "Reactions em coleção pública" },
Comment on lines 50 to 54
"image-proxy": { category: "public", rationale: "Proxy de imagens (anti-hotlink CDN externos)" },
Expand Down
1 change: 0 additions & 1 deletion supabase/functions/e2e-cleanup/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ function clientIp(req: Request): string {
* NÃO inclui carrinhos/mockups com seller_id direto — esses vão em SELLER_ID_TABLES.
*/
const USER_ID_TABLES = [
"favorite_item_reactions",
"favorite_items_trash",
"favorite_items",
"favorite_lists",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
-- ============================================================================
-- DROP: favorite_item_reactions
-- ============================================================================
-- Contexto: tabela de reactions emoji em listas públicas de favoritos.
-- Feature descontinuada em 2026-05-07 (ver docs/AUDITORIA_2026-05-07.md F1-6.6).
-- A edge function `favorites-public-react` já foi removida na mesma data.
-- Tabela com 0 rows em 2026-05-12. Sem FKs apontando para ela.
--
-- Esta migration encerra o ciclo de limpeza, removendo a tabela órfã.
-- Tarefa #2 do redeploy Promo_Gifts (2026-05-12).
-- ============================================================================

DROP TABLE IF EXISTS public.favorite_item_reactions CASCADE;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Falta backup obrigatório antes do DROP

Na Line 13, o DROP TABLE ... CASCADE está sem criação prévia de tabela _backup_*_YYYYMMDD, o que viola a regra de migrações destrutivas e pode causar perda irreversível se a premissa de “0 rows” estiver errada no ambiente alvo.

Sugestão de ajuste
+CREATE TABLE IF NOT EXISTS public._backup_favorite_item_reactions_20260512 AS
+SELECT * FROM public.favorite_item_reactions;
+
 DROP TABLE IF EXISTS public.favorite_item_reactions CASCADE;

As per coding guidelines, "Operações destrutivas (DROP TABLE/COLUMN, TRUNCATE) DEVEM ter backup em tabela backup*_YYYYMMDD antes".

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
DROP TABLE IF EXISTS public.favorite_item_reactions CASCADE;
CREATE TABLE IF NOT EXISTS public._backup_favorite_item_reactions_20260512 AS
SELECT * FROM public.favorite_item_reactions;
DROP TABLE IF EXISTS public.favorite_item_reactions CASCADE;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@supabase/migrations/20260512153020_drop_favorite_item_reactions.sql` at line
13, Antes de executar o DROP TABLE public.favorite_item_reactions CASCADE,
adicionar criação obrigatória de backup seguindo o padrão de nome
_backup_favorite_item_reactions_YYYYMMDD usando SELECT * FROM
public.favorite_item_reactions INTO/CREATE TABLE AS para preservar todos os
dados; garanta que o backup seja criado condicionalmente (não sobrescrever se já
existir) e inclua comentário explicando motivo, então só depois execute DROP
TABLE public.favorite_item_reactions CASCADE; referências: tabela
favorite_item_reactions e padrão de backup _backup_*_YYYYMMDD.


-- Sanity check (cria erro se algo ainda referencia a tabela)
DO $$
BEGIN
IF EXISTS (
SELECT 1 FROM information_schema.tables
WHERE table_schema = 'public' AND table_name = 'favorite_item_reactions'
) THEN
RAISE EXCEPTION 'favorite_item_reactions still exists after DROP';
END IF;
END $$;
Loading