Skip to content
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

Adjust wording for account suspension #2153

Merged
merged 1 commit into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions packages/bsky/src/api/app/bsky/actor/getProfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,10 @@ const presentation = (input: {
!params.canViewTakedowns &&
ctx.views.actorIsTakendown(skeleton.did, hydration)
) {
if (ctx.views.actorIsSuspended(skeleton.did, hydration)) {
throw new InvalidRequestError(
'Account has been temporarily suspended',
'AccountTakedown',
)
} else {
throw new InvalidRequestError(
'Account has been taken down',
'AccountTakedown',
)
}
throw new InvalidRequestError(
'Account has been suspended',
'AccountTakedown',
)
}
return profile
}
Expand Down
7 changes: 0 additions & 7 deletions packages/bsky/src/views/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,6 @@ export class Views {
return !!state.actors?.get(did)?.takedownRef
}

actorIsSuspended(did: string, state: HydrationState): boolean {
return !!state.actors
?.get(did)
?.takedownRef?.toLowerCase()
.includes('suspend')
}

viewerBlockExists(did: string, state: HydrationState): boolean {
const actor = state.profileViewers?.get(did)
if (!actor) return false
Expand Down
23 changes: 1 addition & 22 deletions packages/bsky/tests/views/profile.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,28 +191,7 @@ describe('pds profile views', () => {
{ headers: await network.serviceHeaders(bob) },
)

await expect(promise).rejects.toThrow('Account has been taken down')

// Cleanup
await network.bsky.ctx.dataplane.untakedownActor({
did: alice,
})
})

// @TODO reimplement suspension?
it.skip('blocked by actor suspension', async () => {
await network.bsky.ctx.dataplane.takedownActor({
did: alice,
})
await network.processAll()
const promise = agent.api.app.bsky.actor.getProfile(
{ actor: alice },
{ headers: await network.serviceHeaders(bob) },
)

await expect(promise).rejects.toThrow(
'Account has been temporarily suspended',
)
await expect(promise).rejects.toThrow('Account has been suspended')

// Cleanup
await network.bsky.ctx.dataplane.untakedownActor({
Expand Down
Loading