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

[Epic] Refactor discussion to use Bridget API on apps #9869

Closed
3 tasks done
Tracked by #9667 ...
georgeblahblah opened this issue Dec 13, 2023 · 3 comments
Closed
3 tasks done
Tracked by #9667 ...

[Epic] Refactor discussion to use Bridget API on apps #9869

georgeblahblah opened this issue Dec 13, 2023 · 3 comments
Assignees

Comments

@georgeblahblah
Copy link
Contributor

georgeblahblah commented Dec 13, 2023

What needs to happen

We should refactor the discussion components so that they can use Bridget APIs instead of Discussion API on apps articles for certain functionality. This is because the apps webview doesn't have the authentication cookie or okta token for the authenticated discussion API endpoints.

Background

Discussion API

On web, the discussion API provides endpoints for the following actions:

unauthenticated endpoints

  • fetch comments
  • report abuse

authenticated endpoints

these endpoints are authenticated by cookie or okta auth token

  • post comment
  • post reply to comment
  • upvote comment

On apps

The apps journey is slightly different, as the webview doesn't have knowledge of the user's identity. It doesn't have the GU_U cookie or the okta token, and so calls to the authenticated discussion endpoints will fail.

Instead, Bridget provides a discussion service which exposes some endpoints for similar functionality:

https://github.com/guardian/bridget/blob/88c99c6f311f00db6dab4daf88b9bdcf25225666/thrift/native.thrift#L122-L128

Update 12/02/24

Tasks

  1. 8 of 8
    Discussion Epic
    georgeblahblah mxdvl
  2. 2 of 5
    Discussion Epic
  3. 6 of 6
    Discussion Epic
    georgeblahblah
@mxdvl
Copy link
Contributor

mxdvl commented Jan 30, 2024

@mxdvl mxdvl added the Epic label Jan 30, 2024
@mxdvl mxdvl changed the title Refactor discussion to use Bridget API on apps [Epic] Refactor discussion to use Bridget API on apps Jan 30, 2024
@georgeblahblah
Copy link
Contributor Author

There will be a specific app version (or greater) that supports discussion with Bridget in iOS (and probably Android too), even though the Bridget API has not changed. Given the only mechanism that MAPI has is to specify a required Bridget version for a given piece of content, I suggest that we:

  • release a "ghost" version of Bridget with no changes, which we bundle in the app version which implements discussion for both Android and iOS
  • Specify in MAPI that articles with discussion require this "ghost" version of Bridget to be rendered with DCAR.

@georgeblahblah
Copy link
Contributor Author

georgeblahblah commented Jan 31, 2024

I wonder what we should do with the "sign in copy" on Discussion on apps, and more broadly, the "user is not signed in" scenario:

The current behaviour on the embedded templates is:

  • no "create account or sign in" copy
  • if you are not signed in and initiate a command that requires you to sign in, the app opens the sign in dialog, from which the user can also register.

Options:

  • recreate the same experience as exists on the embedded templates. This would probably require a new Bridget method, as we have no way to launch the "signin/register" dialog as in the screenshot above.
  • ? something else

@github-project-automation github-project-automation bot moved this to Triage in WebX Team Mar 14, 2024
@alinaboghiu alinaboghiu added this to the DCR for Apps milestone Mar 14, 2024
@alinaboghiu alinaboghiu moved this from Triage to Backlog in WebX Team Mar 14, 2024
@mxdvl mxdvl self-assigned this Apr 4, 2024
@georgeblahblah georgeblahblah moved this from Backlog to Blocked in WebX Team Apr 19, 2024
@alinaboghiu alinaboghiu moved this from Blocked to Backlog in WebX Team Apr 25, 2024
@mxdvl mxdvl closed this as completed Jun 19, 2024
@github-project-automation github-project-automation bot moved this from Backlog to Done in WebX Team Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

3 participants