feat: adicione verificao de region no updater - #2
Conversation
QA Review — feat/check-regionVerdict: 🚫 CHANGES REQUESTED — There are blockers that must be fixed before merge. 🔴 Blockers (must fix before merge)1.
|
| Category | Count |
|---|---|
| 🔴 Blockers | 3 |
| 🟡 Warnings | 5 |
| 🔵 Nitpicks | 6 |
The core feature concept is sound and the approach of splitting releases by tag suffix is reasonable. However, the lack of runtime input validation on region is a real bug (silent wrong-region responses), the .DS_Store must never ship, and the dynamic property access should be replaced with a type-safe alternative. Fix those three and address the duplicate IDs and missing US tests before merge.
QA Review — PR #2 (feat: region support)Revisão completa após leitura de 🔴 Blockers1.
2. Falha silenciosa quando nenhuma release BR é encontrada no GitHub const release = data.find(item => { ... isBR ... });
await this.getLatestRelease(release, 'br'); // release pode ser undefined
3. URL de redirect proxy não preserva o url: `${sanitizedBaseUrl}/download/${platformName}?update=true`
// ❌ Faltando: ?update=true®ion=usUm usuário US que chama 4. Type mismatch: // Declaração da classe:
private latest: { version?: SemVer; ... }
// Em getLatestRelease:
this[latestByRegion].version = tag_name; // tag_name é string (ex: "v4.0.0-canary.5")O próprio teste confirma: 🟡 Warnings5. Dynamic property access const latestByRegion = region === 'br' ? 'latest' : 'latestUS';
this[latestByRegion].version = tag_name;TypeScript em modo strict pode rejeitar indexação em propriedades privadas via string union sem index signature. Dependendo da versão do TS e das configurações exatas, isso pode ou não compilar. Recomendação: usar acesso explícito: const cache = region === 'br' ? this.latest : this.latestUS;
cache.version = tag_name;Mais seguro, mais legível, sem ambiguidade. 6. Convenção de tag const isBR = !item.tag_name.includes('-en-US');
const isUS = item.tag_name.includes('-en-US');Não há nenhuma menção no README, no corpo do PR, ou em comentários no código explicando que releases US devem ter o sufixo 7. Ausência total de testes para o path US tag_name: 'v4.0.0-canary.5', // tratado como BRO
8. const { region } = params as { region: CacheRegionType };O cast 🔵 Nitpicks
VerdictREQUEST CHANGES Os bloqueadores 1, 3 e 4 precisam ser corrigidos antes do merge. O bug do redirect sem |
nesse PR adicionamos suporte a region no loadCache via query params
exemplo:
/download/exe?region=us