IO-3166-Global-Notifications-Part-2: checkpoint
This commit is contained in:
@@ -37,10 +37,11 @@ const scenarioParser = async (req, jobIdField) => {
|
||||
// Step 1: Validate we know what user committed the action that fired the parser
|
||||
// console.log("Step 1");
|
||||
|
||||
const hasuraUserRole = event?.session_variables?.["x-hasura-role"];
|
||||
const hasuraUserId = event?.session_variables?.["x-hasura-user-id"];
|
||||
|
||||
// Bail if we don't know who started the scenario
|
||||
if (!hasuraUserId) {
|
||||
if (hasuraUserRole === "user" && !hasuraUserId) {
|
||||
logger.log("No Hasura user ID found, skipping notification parsing", "info", "notifications");
|
||||
return;
|
||||
}
|
||||
@@ -84,7 +85,7 @@ const scenarioParser = async (req, jobIdField) => {
|
||||
authId: watcher?.user?.authid
|
||||
}));
|
||||
|
||||
if (FILTER_SELF_FROM_WATCHERS) {
|
||||
if (FILTER_SELF_FROM_WATCHERS && hasuraUserRole === "user") {
|
||||
jobWatchers = jobWatchers.filter((watcher) => watcher.authId !== hasuraUserId);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user