-
-
Notifications
You must be signed in to change notification settings - Fork 12
Feature/integrate xp contract #603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feature/working-xp-api-changes
Are you sure you want to change the base?
Feature/integrate xp contract #603
Conversation
_enabled: z | ||
.boolean() | ||
.optional() | ||
.default(false) | ||
.describe( | ||
'Whether TigerBeetle is enabled, this allows for pre-defining and shipping default configuration.' | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@LandonSiler We don't need a flag for if tiger beetle is enabled. We can simply allow the tigerBeetle key in the server config to be null/undefined to disable it.
src/aux-records/XpController.ts
Outdated
* Get an Xp user's meta data (Xp meta associated with an auth user) | ||
* Creates an Xp user for the auth user if one does not exist | ||
*/ | ||
async getXpUser(id: GetXpUserById): Promise<GetXpUserResult> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@LandonSiler This function should receive the ID of the currently logged in user in addition to the the ID of the user that the metadata is requested for. This is so we can validate who is allowed to access the metadata for a user and what amount of metadata they can access.
For example, we will eventually start including account balances with these metadata requests, but we don't want to return the account balance for user A to user B.
src/aux-records/XpController.ts
Outdated
} else return result; | ||
} | ||
return user | ||
? { success: true, user } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@LandonSiler Controllers should always try to be explicit about what they are returning so that we don't accidentally return more from the store than should be returned. For example, instead of:
return {
success: true,
user
};
I would prefer:
return {
success: true,
user: {
id: user.id,
accountId: user.accountId,
// etc...
}
};
so we can see exactly what is being returned from the controller without having to consult the store.
src/aux-records/XpController.ts
Outdated
* Get a contract by its id | ||
* @param id The id of the contract to get | ||
*/ | ||
async getContractById(id: XpContract['id']): Promise<GetContractResult> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@LandonSiler This function should also accept the current user ID so that we can validate whether the current user is allowed to access the given contract.
await Promise.race([ | ||
client.lookupAccounts([0n]), | ||
new Promise((_, rej) => { | ||
setTimeout(() => { | ||
rej( | ||
new Error( | ||
'Failed to connect to tigerbeetle server in time.' | ||
) | ||
); | ||
}, 3000); | ||
}), | ||
]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@LandonSiler We don't need to validate the tiger beetle connection on start. If we are having issues, then the server should start but each request should fail. This helps the system recover from temporary failures and not run into issues where we have to manually restart the server executable.
4111dd0
to
7f6dd3b
Compare
|
…Click argument for codeTool bots - These new properties tell the user which bot and tag is currently displayed in the code editor
… branch wasn't found for the temporary connection
…ays fail in some manner
Implement additional properties to determine which bot and tag is displayed in the code editor for a code tool bot
…rer-improvements-troyce
…oken Fix record key issues with `os.getSharedDocument()`
- This means that static insts will be treated similarly to how private insts are treated.
# Conflicts: # CHANGELOG.md
Implement search records
Co-authored-by: KallynGowdy <[email protected]>
Co-authored-by: KallynGowdy <[email protected]>
Co-authored-by: KallynGowdy <[email protected]>
Co-authored-by: KallynGowdy <[email protected]>
Co-authored-by: KallynGowdy <[email protected]>
…e18-4e4b-90de-989bb9220185 Fix: Remove erroneous rounding of from position values in drag/drop events
Co-authored-by: KallynGowdy <[email protected]>
Co-authored-by: KallynGowdy <[email protected]>
…ookEnvironment and WebhookRecordsController
…252-430b-8c7d-710f30acbaba Add ai.listChatModels() function to list available AI chat models
…fc1-4edc-9797-d01703ca209c Add os.eraseInst() function to delete insts programmatically
Co-authored-by: KallynGowdy <[email protected]>
…eeb-4d07-a396-03da62d6039a Fix sheetPortal button to prioritize mapPortal over gridPortal when inferring dimension
…o the record that the webhook owns - This prevents potential leaks by allowing the webhook to read its own logs by default. - Also makes managing file subscriptions for webhooks easier.
- This fixes trying to publish package versions into studios, or in cases where the system is recording a file to a studio
# Conflicts: # package.json # pnpm-lock.yaml # src/aux-common/common/PolicyPermissions.ts # src/aux-common/rpc/ErrorCodes.spec.ts # src/aux-common/rpc/ErrorCodes.ts # src/aux-common/rpc/Result.spec.ts # src/aux-common/rpc/Result.ts # src/aux-records/AuthController.spec.ts # src/aux-records/MemoryStore.ts # src/aux-records/PolicyController.spec.ts # src/aux-records/PolicyStore.ts # src/aux-records/RecordsServer.spec.ts # src/aux-records/RecordsServer.ts # src/aux-records/SubscriptionConfigBuilder.ts # src/aux-records/SubscriptionConfiguration.ts # src/aux-records/Utils.ts # src/aux-records/__snapshots__/RecordsServer.spec.ts.snap # src/aux-records/__snapshots__/ServerConfig.spec.ts.snap # src/aux-records/crud/CrudRecordsController.ts # src/aux-records/crud/CrudRecordsControllerTests.ts # src/aux-records/index.ts # src/aux-records/webhooks/WebhookRecordsController.ts # src/aux-runtime/runtime/AuxLibrary.spec.ts # src/aux-runtime/runtime/AuxLibrary.ts # src/aux-runtime/runtime/AuxLibraryDefinitions.def # src/aux-runtime/runtime/RecordsEvents.ts # src/aux-server/aux-backend/prisma/index.ts # src/aux-server/aux-backend/schemas/auth.prisma # src/aux-server/aux-backend/shared/ServerBuilder.ts # src/aux-server/aux-web/aux-auth/site/index.ts # src/aux-vm/managers/RecordsManager.ts
No description provided.