Skip to content

Commit

Permalink
Remove unnecessary console logs from hocuspocus-server
Browse files Browse the repository at this point in the history
The redundant console logs have been removed from the hocuspocus-server file, specifically from the document fetch function and the user authentication process. This change is aimed towards cleaner code—avoiding log pollution and making the function processes more readable.
  • Loading branch information
claygorman committed Dec 20, 2023
1 parent 71017ee commit 793ac0a
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions backend/src/services/hocuspocus-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ const hocuspocusServer = Server.configure({
fetch: ({ documentName }) => {
return new Promise(async (resolve, reject) => {
const [entityType, entityId, entityField] = documentName.split('.');
console.log({ action: 'Fetching tiptap document', documentName, entityType, entityId, entityField });

if (entityType === 'issue' && entityField === 'description') {
let issue = null;
Expand All @@ -30,7 +29,6 @@ const hocuspocusServer = Server.configure({
if (!issue || !issue?.descriptionRaw) resolve(null);

const descriptionAsUnit8Array = new Uint8Array(issue.descriptionRaw);
console.log({ descriptionAsUnit8Array, issue });
resolve(descriptionAsUnit8Array.length === 0 ? null : descriptionAsUnit8Array);
}

Expand Down Expand Up @@ -95,13 +93,10 @@ const hocuspocusServer = Server.configure({
verifyJwt = await axios.get(`${FRONTEND_HOSTNAME}/api/verify-jwt`, {
headers: {
authorization: `Bearer ${token}`,
cookie: data.requestHeaders.cookie,
'user-agent': data.requestHeaders['user-agent'],
},
});
} catch (e) {
console.error({ onAuthenticated: true, e });
throw new Error('Unable to verify!');
throw new Error('Unable to verify tiptap user!');
}

const {
Expand All @@ -112,8 +107,6 @@ const hocuspocusServer = Server.configure({

const user = await db.sequelize.models.User.findOne({ where: { externalId } });

console.log({ hocuspocusOnAuth: true, user: user ? user.toJSON() : null });

return {
user: user ? user.toJSON() : null,
};
Expand Down

0 comments on commit 793ac0a

Please sign in to comment.