Skip to content

Conversation

@MaxGhenis
Copy link
Contributor

@MaxGhenis MaxGhenis commented Nov 25, 2025

Summary

Remove debug logging statements that were accidentally left in adapter files.

Files fixed

  • app/src/adapters/conversionHelpers.ts - Removed 12 console.log statements and unused isProxy helper function
  • app/src/adapters/SimulationAdapter.ts - Removed 4 console.log statements
  • app/src/adapters/HouseholdAdapter.ts - Removed 2 console.warn statements

Why

These debug statements were causing lint warnings and polluting the browser console in production.

🤖 Generated with Claude Code

@vercel
Copy link

vercel bot commented Nov 25, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
policyengine-app-v2 Ready Ready Preview Comment Nov 25, 2025 11:31am

Remove debug logging statements that were accidentally left in:
- conversionHelpers.ts: 12 console.log statements and unused isProxy helper
- SimulationAdapter.ts: 4 console.log statements
- HouseholdAdapter.ts: 2 console.warn statements

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Copy link
Collaborator

@anth-volk anth-volk left a comment

Choose a reason for hiding this comment

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

Thanks for this @MaxGhenis. There are some console.warn() and console.error() statements that I think we want to keep for RUM monitoring purposes.

householdData[camelKey] = value as any;
} catch (error) {
// If entity not found in metadata, still include it but log warning
console.warn(`Entity "${key}" not found in metadata, including anyway`);
Copy link
Collaborator

Choose a reason for hiding this comment

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

issue, blocking: We do want console.warn statements. We'll use these with RUM monitoring down the road to diagnose bugs.

} else {
// If not found in metadata, try snake_case conversion
const snakeKey = key.replace(/([A-Z])/g, '_$1').toLowerCase();
console.warn(`Entity "${key}" not found in metadata, using snake_case "${snakeKey}"`);
Copy link
Collaborator

Choose a reason for hiding this comment

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

issue, blocking: Here, too, let's keep the console.warn()

parsedKeys: parsedOutput ? Object.keys(parsedOutput) : [],
});
} catch (error) {
console.error('[SimulationAdapter.fromMetadata] Failed to parse output:', error);
Copy link
Collaborator

Choose a reason for hiding this comment

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

issue, blocking: Let's keep this console.error()

test('given entity not in metadata then includes it anyway', () => {
const result = HouseholdAdapter.fromMetadata(mockHouseholdMetadataWithUnknownEntity);

expect(console.warn).toHaveBeenCalledWith(
Copy link
Collaborator

Choose a reason for hiding this comment

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

issue, non-blocking: Perhaps better to keep this, since we'd be looking to keep the console.warn(), as well

test('given entity not in metadata then toCreationPayload uses snake_case', () => {
const result = HouseholdAdapter.toCreationPayload(mockHouseholdDataWithUnknownEntity, 'uk');

expect(console.warn).toHaveBeenCalledWith(
Copy link
Collaborator

Choose a reason for hiding this comment

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

issue, non-blocking: Better to keep

const result = HouseholdAdapter.fromMetadata(metadata as any);

expect(result.householdData.people).toBeDefined();
expect(console.warn).toHaveBeenCalled();
Copy link
Collaborator

Choose a reason for hiding this comment

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

issue, non-blocking: Here, too

@MaxGhenis
Copy link
Contributor Author

Feel free to revise the PR as you see fit. Was just a bit annoying seeing all the messages about these when filing unrelated PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants