Skip to content

Conversation

@mryraghi
Copy link

@mryraghi mryraghi commented Aug 29, 2023

In order to avoid running updateOrg() on existing users, triggering a re-creation of Stripe customers, leading to duplicates, I've added the metadata tier.org = "org:user_xyz" to existing Stripe customers.

This successfully make Tier recognize the user. However, when running tier.can(), I get:

/node_modules/tier/src/client.ts:506
    for (const usage of limits.usage) {
                               ^
TypeError: limits.usage is not iterable
    at Tier.<anonymous> (/Users/romeo/Development/receiptor/receiptor-backend/node_modules/tier/src/client.ts:506:32)
    at Generator.next (<anonymous>)
    at fulfilled (/Users/romeo/Development/receiptor/receiptor-backend/node_modules/tier/dist/cjs/client.js:8:58)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)

Hence, I've added nullish coalescing for more precise default handling.

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.

1 participant