Move "Report" feature to inside of app? #909

Closed
opened 2017-12-28 18:40:18 +01:00 by tzarebczan · 18 comments
tzarebczan commented 2017-12-28 18:40:18 +01:00 (Migrated from github.com)

The Issue

The Report feature, which is used to report content for infringement, opens in a separate web page outside of the app.

Should this be moved to inside the app eventually?

System Configuration

  • LBRY Daemon version:
  • LBRY App version:
  • LBRY Installation ID:
  • Operating system:

Anything Else

Screenshots

<!-- Thanks for reporting an issue to LBRY and helping us improve! To make it possible for us to help you, please fill out below information carefully. Before reporting any issues, please make sure that you're using the latest version. - App releases: https://github.com/lbryio/lbry-app/releases - Standalone daemon: https://github.com/lbryio/lbry/releases We are also available on live chat at https://chat.lbry.io --> ## The Issue The Report feature, which is used to report content for infringement, opens in a separate web page outside of the app. Should this be moved to inside the app eventually? ## System Configuration <!-- For the app, this info is in the About section at the bottom of the Help page. You can include a screenshot instead of typing it out --> <!-- For the daemon, run: curl 'http://localhost:5279' --data '{"method":"version"}' and include the full output --> - LBRY Daemon version: - LBRY App version: - LBRY Installation ID: - Operating system: ## Anything Else <!-- Include anything else that does not fit into the above sections --> ## Screenshots <!-- If a screenshot would help explain the bug, please include one or two here -->
neb-b commented 2017-12-29 04:24:52 +01:00 (Migrated from github.com)

I think this should definitely live inside the app. Shouldn't be too difficult.

I think this should definitely live inside the app. Shouldn't be too difficult.
miikkatu commented 2018-04-11 09:54:05 +02:00 (Migrated from github.com)

Working on this.

Working on this.
miikkatu commented 2018-04-11 11:58:58 +02:00 (Migrated from github.com)

@seanyesmunt @tzarebczan I have an implementation ready, but it's missing the actual submitting of the report. I couldn't figure out how the current web form does the submitting, and there's nothing in the app for this yet.

How this implementation works is:

  1. Click the report button on a file page
  2. App shows report page and prefills the uri of the file
  3. Fill in the form and submit
  4. App shows a confirmation with snackbar and navigates back to the file page

This can also be used by itself, for example from the sidebar. Only then the infringing file uri would not be prefilled.

screen shot 2018-04-11 at 12 35 58
@seanyesmunt @tzarebczan I have an implementation ready, but it's missing the actual submitting of the report. I couldn't figure out how the current web form does the submitting, and there's nothing in the app for this yet. How this implementation works is: 1. Click the report button on a file page 2. App shows report page and prefills the uri of the file 3. Fill in the form and submit 4. App shows a confirmation with snackbar and navigates back to the file page This can also be used by itself, for example from the sidebar. Only then the infringing file uri would not be prefilled. <img width="514" alt="screen shot 2018-04-11 at 12 35 58" src="https://user-images.githubusercontent.com/16205520/38609736-86df3e2a-3d87-11e8-9ff0-2e9a7641a11e.png">
kauffj commented 2018-04-17 16:08:26 +02:00 (Migrated from github.com)

@miikkatu thanks for working on this. Unfortunately, the current end behavior of a DMCA report is just trigger an email (see here) and this is not easy to just move into the app.

I filed an issue in our internal-apis project to build an endpoint for receiving these, but I'm afraid this one is blocked until that happens.

Although I suppose you could post to lbry.io/dmca in the interim... that would allow this to be shipped.

@miikkatu thanks for working on this. Unfortunately, the current end behavior of a DMCA report is just trigger an email (see [here](https://github.com/lbryio/lbry.io/blob/90eae9cbfc7a66dba9b59c51652adf06a63f0718/controller/action/ReportActions.class.php)) and this is not easy to just move into the app. I filed an issue in our internal-apis project to build an endpoint for receiving these, but I'm afraid this one is blocked until that happens. Although I suppose you could post to lbry.io/dmca in the interim... that would allow this to be shipped.
miikkatu commented 2018-04-17 17:40:27 +02:00 (Migrated from github.com)

Although I suppose you could post to lbry.io/dmca in the interim

I was thinking about this too. For this, we would need an URL where to POST, and an object format that it would accept. I couldn't figure those out in the lbry.io/dcma code. Then, a team member could verify if the posted data is proper or not.

Otherwise, we could wait with this until there's an endpoint available. 🙂

> Although I suppose you could post to lbry.io/dmca in the interim I was thinking about this too. For this, we would need an URL where to POST, and an object format that it would accept. I couldn't figure those out in the lbry.io/dcma code. Then, a team member could verify if the posted data is proper or not. Otherwise, we could wait with this until there's an endpoint available. 🙂
tzarebczan commented 2018-04-17 20:39:40 +02:00 (Migrated from github.com)

post

@miikkatu this is what the post call looks like - should be able to pass the same parameters (might need to URL encode them as well)

If it helps, the server side code is here: 90eae9cbfc/controller/action/ReportActions.class.php / 810acf0c1f/view/template/report/dmca.php

![post](https://user-images.githubusercontent.com/8120721/38889548-0e68598e-424d-11e8-9735-e7662e5ddedf.jpg) @miikkatu this is what the post call looks like - should be able to pass the same parameters (might need to URL encode them as well) If it helps, the server side code is here: https://github.com/lbryio/lbry.io/blob/90eae9cbfc7a66dba9b59c51652adf06a63f0718/controller/action/ReportActions.class.php / https://github.com/lbryio/lbry.io/blob/810acf0c1f6368c30093a1fb5c5edb9b7d5f0a9a/view/template/report/dmca.php
miikkatu commented 2018-04-19 07:23:35 +02:00 (Migrated from github.com)

I now have a CORS issue. I use a similar approach when making the POST as in Lbryio.call function. However, I get a 405 response.

The code bit that does the request is like this:

      const report = {
        email: this.state.email,
        identifier: this.state.identifier,
        name: this.state.name,
        rightsholder: this.state.rightsholder,
      };

      const qs = querystring.stringify(report);
      const options = {
        method: 'POST',
        headers: {
          'Content-Type': 'application/x-www-form-urlencoded',
        },
        body: qs,
      };

      fetch('https://lbry.io/dcma', options).then(response => {
        // fetch returns 405 (method not allowed)
screen shot 2018-04-19 at 8 13 12 screen shot 2018-04-19 at 8 11 07
I now have a CORS issue. I use a similar approach when making the POST as in `Lbryio.call` function. However, I get a 405 response. The code bit that does the request is like this: ```javascript const report = { email: this.state.email, identifier: this.state.identifier, name: this.state.name, rightsholder: this.state.rightsholder, }; const qs = querystring.stringify(report); const options = { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded', }, body: qs, }; fetch('https://lbry.io/dcma', options).then(response => { // fetch returns 405 (method not allowed) ``` <img width="301" alt="screen shot 2018-04-19 at 8 13 12" src="https://user-images.githubusercontent.com/16205520/38972695-c920dc20-43aa-11e8-97f1-56c327c61368.png"> <img width="461" alt="screen shot 2018-04-19 at 8 11 07" src="https://user-images.githubusercontent.com/16205520/38972685-badf73ce-43aa-11e8-9092-36d6fd71cdd2.png">
kauffj commented 2018-04-24 18:05:32 +02:00 (Migrated from github.com)

@miikkatu we'll likely get this fixed web-side within a week or so. I'm inclined to just allow unrestricted POSTs to lbry.io/dmca.

See https://github.com/lbryio/lbry.io/issues/517

@miikkatu we'll likely get this fixed web-side within a week or so. I'm inclined to just allow unrestricted POSTs to lbry.io/dmca. See https://github.com/lbryio/lbry.io/issues/517
maximest-pierre commented 2018-04-29 18:12:20 +02:00 (Migrated from github.com)

PR has been submitted on lbry.io https://github.com/lbryio/lbry.io/pull/525

PR has been submitted on lbry.io https://github.com/lbryio/lbry.io/pull/525
kauffj commented 2018-05-01 21:31:04 +02:00 (Migrated from github.com)

@miikkatu CORS change is merged if you want to test this in app. Feel free to spam the endpoint, they only come to a few people and they'll be aware. (@finer9 @tzarebczan)

@miikkatu CORS change is merged if you want to test this in app. Feel free to spam the endpoint, they only come to a few people and they'll be aware. (@finer9 @tzarebczan)
miikkatu commented 2018-05-02 09:21:26 +02:00 (Migrated from github.com)

I still get the same CORS error. Have the merged change been deployed to the site yet?

I still get the same CORS error. Have the merged change been deployed to the site yet?
tzarebczan commented 2018-05-02 16:51:14 +02:00 (Migrated from github.com)

Hmm, @maximest-pierre any thoughts? It was merged here: https://github.com/lbryio/lbry.io/pull/525

Hmm, @maximest-pierre any thoughts? It was merged here: https://github.com/lbryio/lbry.io/pull/525
maximest-pierre commented 2018-05-02 16:53:21 +02:00 (Migrated from github.com)

Yes it was merge, I look at it quickly this morning. Both GET and POST header shows that its enabled.

Yes it was merge, I look at it quickly this morning. Both GET and POST header shows that its enabled.
maximest-pierre commented 2018-05-02 17:06:50 +02:00 (Migrated from github.com)

Is it still a 405 error or is it a 301 error now. @miikkatu

Is it still a 405 error or is it a 301 error now. @miikkatu
miikkatu commented 2018-05-02 17:10:32 +02:00 (Migrated from github.com)

@maximest-pierre 405, just like before (screenshot above).

@maximest-pierre 405, just like before (screenshot above).
maximest-pierre commented 2018-05-02 17:19:24 +02:00 (Migrated from github.com)

Can you open a PR with your current code so I can recreate your error.

Can you open a PR with your current code so I can recreate your error.
miikkatu commented 2018-05-02 17:32:52 +02:00 (Migrated from github.com)

@maximest-pierre PR opened. The fetch request code is in src/renderer/page/reportcontent/view.jsx. Hopefully you can recreate the error and find out what's going on. 🙂

@maximest-pierre PR opened. The fetch request code is in src/renderer/page/reportcontent/view.jsx. Hopefully you can recreate the error and find out what's going on. 🙂
alyssaoc commented 2018-10-09 19:42:55 +02:00 (Migrated from github.com)

closing, we will keep the webpage and not move into the app

closing, we will keep the webpage and not move into the app
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/lbry-desktop#909
No description provided.