Skip to main content
Clarified question; trimmed and annotated images; incorporated comments (now deleted).
Source Link
Brock Adams
  • 13k
  • 5
  • 39
  • 64

Incorrect can_flag value from Comments have incorrect `can_flag` values for at least 2 different API Methodsroutes

I am trying to retrievesee and show ifwhether a comment on question/answer is flagged or notby the authenticated user.

  1. But whenever I use /questions/{ids}, can_flag is true irregardless of whether the user (me) can actually flag the comment.
  2. When I use /comments/{ids}, I get the correct status.
  3. Editors note: additional/updated/different info in the answer below, but this still looks like a set of bugs.

I see there is can_flag variable but whenever I use /questions/{ids} i always get can_flag is true.Example:

  1. For The API Sandbox question on Meta Stack Exchange:

  2. In this answer there (Id 54725), I flagged the (now deleted) comment with ID 764560 (Link now works only for SE devs and MetaSE moderators).

  3. But the /questions/{ids} route shows can_flag: true, which is incorrect:

However when i retrieved individual comment using /comments/{ids} i am getting correct status.questions route shows incorrect can_flag


2. However, using `/comments/{ids}` I get `can_flag: false`, which is **correct**:

Example:comments route shows correct can_flag for flagged comment


2. I also tried `/comments/{ids}` **for an unflagged comment** ([comment ID:396655][8]). It gives`can_flag: true`, which is **correct**:

Question ID: 51812 Site: metacomments route shows correct can_flag for unflagged comment

In first Answer, I flagged 5th comment (Comment ID: 764560). Below screenshotWhy is from /questions/{ids} and i am receivingthere an inconsistency? can_flag=true.This looks like a bug.

enter image description here

 

However when i callNote: I did (re)check /commentsquestions/{ids} I get can_flag=false which is correct. I also tried with 4th30 minutes after flagging the comment (Comment ID:396655) for which i received can_flag=true.

4th Comment

enter image description here

5th Comment

enter image description here

Why is there an inconsistency? Is So this does not seem to be a bug? or is this designed this way?time-delay/caching issue.

Incorrect can_flag value from 2 different API Methods

I am trying to retrieve and show if a comment on question/answer is flagged or not.

I see there is can_flag variable but whenever I use /questions/{ids} i always get can_flag is true.

However when i retrieved individual comment using /comments/{ids} i am getting correct status.

Example:

Question ID: 51812 Site: meta

In first Answer, I flagged 5th comment (Comment ID: 764560). Below screenshot is from /questions/{ids} and i am receiving can_flag=true.

enter image description here

However when i call /comments/{ids} I get can_flag=false which is correct. I also tried with 4th comment (Comment ID:396655) for which i received can_flag=true.

4th Comment

enter image description here

5th Comment

enter image description here

Why is there an inconsistency? Is this a bug? or is this designed this way?

Comments have incorrect `can_flag` values for at least 2 different API routes

I am trying to see and show whether a comment on question/answer is flagged by the authenticated user.

  1. But whenever I use /questions/{ids}, can_flag is true irregardless of whether the user (me) can actually flag the comment.
  2. When I use /comments/{ids}, I get the correct status.
  3. Editors note: additional/updated/different info in the answer below, but this still looks like a set of bugs.

Example:

  1. For The API Sandbox question on Meta Stack Exchange:

  2. In this answer there (Id 54725), I flagged the (now deleted) comment with ID 764560 (Link now works only for SE devs and MetaSE moderators).

  3. But the /questions/{ids} route shows can_flag: true, which is incorrect:

questions route shows incorrect can_flag


2. However, using `/comments/{ids}` I get `can_flag: false`, which is **correct**:

comments route shows correct can_flag for flagged comment


2. I also tried `/comments/{ids}` **for an unflagged comment** ([comment ID:396655][8]). It gives`can_flag: true`, which is **correct**:

comments route shows correct can_flag for unflagged comment

Why is there an inconsistency? This looks like a bug.

 

Note: I did (re)check /questions/{ids} 30 minutes after flagging the comment. So this does not seem to be a time-delay/caching issue.

Source Link
AVK
  • 279
  • 1
  • 10

Incorrect can_flag value from 2 different API Methods

I am trying to retrieve and show if a comment on question/answer is flagged or not.

I see there is can_flag variable but whenever I use /questions/{ids} i always get can_flag is true.

However when i retrieved individual comment using /comments/{ids} i am getting correct status.

Example:

Question ID: 51812 Site: meta

In first Answer, I flagged 5th comment (Comment ID: 764560). Below screenshot is from /questions/{ids} and i am receiving can_flag=true.

enter image description here

However when i call /comments/{ids} I get can_flag=false which is correct. I also tried with 4th comment (Comment ID:396655) for which i received can_flag=true.

4th Comment

enter image description here

5th Comment

enter image description here

Why is there an inconsistency? Is this a bug? or is this designed this way?