Skip to content

Commit

Permalink
fix(alias): encode path again to match the alias in database
Browse files Browse the repository at this point in the history
Before, the encoded path was sent to the database layer.
It is strange that we decode, encode and decode it again, can't see
the reason for it now. We may try not to encode it at all in the future.
  • Loading branch information
hugotiburtino committed Jul 2, 2024
1 parent ce71573 commit 86721cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/server/src/schema/uuid/abstract-uuid/resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ async function resolveIdFromAlias(
return await resolveIdFromUsername(usernameMatch.groups.username, context)
}

cleanPath = cleanPath.slice(1)
cleanPath = decodePath(cleanPath.slice(1))
// The following check is to avoid DB lookups for paths that we know do
// not belong to UUIDs. This is a performance optimization.
// Original code see https://github.com/serlo/database-layer/blob/71b80050ecda63d616ab34eda0fa1143cb9e3ddc/server/src/alias/model.rs#L17-L63
Expand Down

0 comments on commit 86721cd

Please sign in to comment.