# Bug OP-17173 - Polling work package activity updates can cause Browser's Basic auth pop-up

Project: OpenProject
Status: closed
URL: https://community.openproject.org/work_packages/OP-17173

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | High |
| Module | Modules and project features / Comments and activity |
| Target versions | 16.0.1 |
| Observed in versions | 15.5.0 |
| Sprint | 16.0.1 |
| Backlog bucket |  |
| Bug found in version (deprecated) | 15.5.x |
| Found in mobile app version |  |
| Follow-up feedback e-mail |  |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager |  |
| Developers | Mir Bhatia |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

| Attribute | Value |
| --- | --- |
| Relevance |  |

## Costs

| Attribute | Value |
| --- | --- |
| Votes |  |
| Work |  |
| Labor costs |  |

## Description

### Steps to reproduce

1.  Set a session timeout of 5 minutes in [admin settings](https://openproject.local/admin/settings/authentication)

2.  Go to a work package page and open the activity tab (/projects/:slug/work\_packages/:id/activity)

3.  Suspend your computer (e.g. close laptop lid) for at least 5 minutes

4.  Resume computer and open the tab, wait a bit

Alternatively (faster approach):

1.  Go to a work package page and open the activity tab (/projects/:slug/work\_packages/:id/activity)

2.  Open your browser developer tools and delete the session cookie

3.  Wait a couple of seconds until the polling requests is done

### What is the buggy behavior?

The browser shows a pop-up to enter username and password (not an OpenProject login form, a browser pop-up).

### What is the expected behavior?

No UI feedback. That might look surprising but there are far too many reasons why error could appear that are only temporary, like network outages or server redeployments. Then it is even annoying that a rather low prio background polling has a permanent effect on the front-end, e.g. an error flash message. I believe we simply swallow this kind of errors. 

### Technical notes (Root Cause)

The cause of this seems to be, that the frontend code polling `/work_packages/:id/activities/update_streams` does not include the `X-Authentication-Scheme: Session` header. Most other frontend requests we do, include this header. It is used to guide the server's response in the `WWW-Authenticate` header, which the user interprets to decide whether a login form should be shown or not.

The root cause might be the same as for <mention class="mention" data-id="64088" data-type="work_package" data-text="#64088">#64088</mention>.

### Screenshots

Similar to this one (but with a different page in the background):

<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/605017/content">
