Skip to content

Commit e454a36

Browse files
Copilothotlong
andcommitted
fix: rename getMetadata to getMeta in http-dispatcher to match IAnalyticsService contract
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 3633e3b commit e454a36

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

ROADMAP.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ This strategy ensures rapid iteration while maintaining a clear path to producti
125125
| DashboardWidget discriminated union by type | 🔴 | Planned — chart/metric/pivot subtypes with type-specific required fields |
126126
| CI lint rule rejecting new `z.any()` | 🔴 | Planned — eslint or custom lint rule to block `z.any()` additions |
127127
| Dispatcher async `getService` bug fix || All `getService`/`getObjectQLService` calls in `http-dispatcher.ts` now properly `await` async service factories. Covers `handleAnalytics`, `handleAuth`, `handleStorage`, `handleAutomation`, `handleMetadata`, `handleUi`, `handlePackages`. All 7 framework adapters (Express, Fastify, Hono, Next.js, SvelteKit, NestJS, Nuxt) updated to use `getServiceAsync()` for auth service resolution. |
128+
| Analytics `getMetadata``getMeta` naming fix || `handleAnalytics` in `http-dispatcher.ts` called `getMetadata({ request })` which didn't match the `IAnalyticsService` contract (`getMeta(cubeName?: string)`). Renamed to `getMeta()` and aligned call signature. Updated test mocks accordingly. |
128129

129130
---
130131

packages/runtime/src/http-dispatcher.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ describe('HttpDispatcher', () => {
216216
it('should resolve analytics service from Promise (async factory)', async () => {
217217
const mockAnalytics = {
218218
query: vi.fn().mockResolvedValue({ rows: [{ id: 1 }], total: 1 }),
219-
getMetadata: vi.fn().mockResolvedValue({ tables: ['t1'] }),
219+
getMeta: vi.fn().mockResolvedValue({ tables: ['t1'] }),
220220
generateSql: vi.fn().mockResolvedValue({ sql: 'SELECT 1' }),
221221
};
222222
// Inject as Promise (simulates async factory registration)
@@ -245,7 +245,7 @@ describe('HttpDispatcher', () => {
245245

246246
it('should handle GET /analytics/meta with async service', async () => {
247247
const mockAnalytics = {
248-
getMetadata: vi.fn().mockResolvedValue({ tables: ['users', 'orders'] }),
248+
getMeta: vi.fn().mockResolvedValue({ tables: ['users', 'orders'] }),
249249
};
250250
(kernel as any).getService = vi.fn().mockResolvedValue(mockAnalytics);
251251

packages/runtime/src/http-dispatcher.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ export class HttpDispatcher {
541541

542542
// GET /analytics/meta
543543
if (subPath === 'meta' && m === 'GET') {
544-
const result = await analyticsService.getMetadata({ request: context.request });
544+
const result = await analyticsService.getMeta();
545545
return { handled: true, response: this.success(result) };
546546
}
547547

0 commit comments

Comments
 (0)