Closed Bug 1419419 Opened 7 years ago Closed 6 years ago

ISE for revision dashboard when it includes a revision for a deleted document

Categories

(developer.mozilla.org Graveyard :: Dashboards, enhancement, P2)

All
Other
enhancement

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jwhitlock, Assigned: jwhitlock)

References

Details

(Keywords: in-triage, Whiteboard: [specification][type:bug][points=6+])

What did you do?
================
Load revision dashboard for some older users, such as clicking the "View All Activity" button on the profile:

https://developer.mozilla.org/en-US/profiles/sebmozilla 
https://developer.mozilla.org/en-US/dashboards/revisions?user=sebmozilla

What happened?
==============
An Internal Server Error is returned

What should have happened?
==========================
A list of revisions by that user, such as:

https://developer.mozilla.org/en-US/dashboards/revisions?user=jwhitlock

Is there anything else we should know?
======================================
Tracked in Sentry:

https://sentry.prod.mozaws.net/operations/mdn-prod/issues/692434/

UndefinedError:

'kuma.wiki.models.Revision_Deferred_content object' has no attribute 'previous'

It appears to be accessed here:

https://github.com/mozilla/kuma/blob/master/kuma/dashboards/jinja2/dashboards/includes/revision_dashboard_body.html#L20

and has started after this PR was merged:

https://github.com/mozilla/kuma/pull/4520
The problem appears to be when a user has revisions on a soft-deleted document.
Keywords: in-triage
Priority: -- → P2
Summary: ISE for revision dashboard when filtering by user → ISE for revision dashboard when filtering by some users
See Also: → 1417170
See Also: → 1440908
Assignee: nobody → jwhitlock
This affects the revision dashboard any time there is a revision of a deleted document that would be displayed. To reproduce locally:

1) Create a new page, like http://localhost:8000/en-US/docs/user:jwhitlock/delete_test
2) Delete the new page
3) View the dashboard http://localhost:8000/en-US/dashboards/revisions

The existing template appears to handle the case of deleted documents, however the optimized query doesn't include deleted documents:

https://github.com/mozilla/kuma/blob/f8ac57c7765a1fadc1aae4ddea2376625f37dd57/kuma/dashboards/jinja2/dashboards/includes/revision_dashboard_body.html#L37-L38

A full fix includes converting the dashboard tests and adding a test case for a deleted document:

https://github.com/mozilla/kuma/blob/f8ac57c7765a1fadc1aae4ddea2376625f37dd57/kuma/dashboards/tests/test_views.py
Assignee: jwhitlock → nobody
Summary: ISE for revision dashboard when filtering by some users → ISE for revision dashboard when it includes a revision for a deleted document
Whiteboard: [specification][type:bug] → [specification][type:bug][points=6+]
Assignee: nobody → jwhitlock
Status: NEW → ASSIGNED
Commits pushed to master at https://github.com/mozilla/kuma

https://github.com/mozilla/kuma/commit/0a6478e2f75fb1f8eda641381ef91d6c8934bd91
bug 1419419: Drop Flag setup from test

The SPAM_SUBMISSIONS_FLAG doesn't control the display of the "Submit as
Spam" flag. Instead, it is the permission to create a
RevisionAkismetSubmission, which the admin user already has.

https://github.com/mozilla/kuma/commit/dde212f889740bb33e77f39f21e004c787c2721e
bug 1419419: Refactor dashboard views tests

Convert dashboard views tests to pytest, with a set of 9 generated
documents and revisions, which may be easier to adjust in the future,
rather than 11 revisions loaded as Django fixtures, shared by all wiki
document tests.

https://github.com/mozilla/kuma/commit/9d217e47b8da241b053b563c43563a9938f32b8b
bug 1419419: Include deleted docs in rev dashboard

Include revisions for deleted documents in the revision dashboard, and
test that they have the "deleted" tag.

https://github.com/mozilla/kuma/commit/117d79d048d1bcd3f35c4872fbb508858383389a
Merge pull request #4755 from jwhitlock/revision-dashboard-deleted-docs-1419419

bug 1419419: Handle deleted documents on the revision dashboard
This page now loads without error:

https://developer.mozilla.org/en-US/dashboards/revisions?user=sebmozilla

Halfway down the page, there is an entry for "Oct 9, 2010, 3:18:12 PM", for "Forms in HTML", with a red "deleted" tag.
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Product: developer.mozilla.org → developer.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.