Skip to content

Commit

Permalink
fix[databse-client]: logging messages to debug issues writing to comp…
Browse files Browse the repository at this point in the history
  • Loading branch information
nutrina authored Jan 24, 2024
1 parent 13f1974 commit 8032585
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions database-client/src/composeDatabase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,9 @@ export class ComposeDatabase implements CeramicStorage {
};

patchStamps = async (stampPatches: StampPatch[]): Promise<PassportLoadResponse> => {
console.log("patchStamps:", stampPatches);
const deleteRequests = await this.deleteStamps(stampPatches.map((patch) => patch.provider));
console.log("patchStamps deleteRequests:", deleteRequests);

const stampsToCreate = stampPatches
.filter((stampPatch) => stampPatch.credential)
Expand All @@ -306,13 +308,16 @@ export class ComposeDatabase implements CeramicStorage {
credential: stampPatch.credential,
}));

console.log("patchStamps stampsToCreate:", stampsToCreate);
const createRequest = await this.addStamps(stampsToCreate);
console.log("patchStamps createRequest:", createRequest);

const errorDetails = [
...(deleteRequests?.errorDetails?.messages || []),
...(createRequest?.errorDetails?.messages || []),
];

console.log("patchStamps errorDetails:", errorDetails);
return {
status: errorDetails.length > 0 ? "ExceptionRaised" : "Success",
errorDetails: {
Expand Down

0 comments on commit 8032585

Please sign in to comment.