Keeping track of public documents I visited while being anonymous

Open
#819 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
django, python, react

Research direction

Reproduce the anonymous public-document visit and later login flow described in the issue, then trace the frontend visit and login entry points around localStorage and the backend LinkTrace table. Verify that the document appears on the logged-in user's home page after the visit is accounted for; no specific file or test is named in the report.

Written by the indexing model from the issue text.

Description

feature javascript

Bug Report

Problematic behavior
It's the second time a user gives me the following feedback:

When I visit a public document, I want it to be listed in my documents otherwise I can't find it the next time I come to Docs.

After investigating, it turns out that the users encountering this issue, were not connected when they visited the public document. In this case, the backend has not created the entry in the LinkTrace table because no user was logged-in...

Expected behavior/code
When a user visits a public Document as anonymous (happens a lot on federations that have a short lived session). We should be able to track the visit the next time the user logs in to Docs.

Steps to Reproduce

  1. Create a public document with user A
  2. Open a private browser session
  3. Visit the document without being logged-in
  4. Log-in with a user B
  5. The document is not listed on the home page. It should be.

Environment

  • Impress version: 2.6.0
  • Platform: Docker/k8s

Possible Solution
We can develop a solution without modifying the backend.

  1. When an anonymous user visits a public document, keep track of the visit in localstorage
  2. When a user logs-in, check the records in localstorage and make a get on each document after logging the user so that all visits are accounted for in the backend.
Dominant language
Python
Stars
16.8k
Forks
638
Avg merge
1d 15h
Merged PRs (30d)
40

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from suitenumerique/docs

All issues in suitenumerique/docs

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.