session_start shouldn't be called in CLI context

Open
#24 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
php
Domain
backend, testing

Research direction

Locate the session-check test and its controller or service entry point, then reproduce it in a CLI context. Review how the session is currently obtained and assess using RequestStack instead; done means CLI monitoring no longer calls session_start() and the check is ignored when no session is available.

Written by the indexing model from the issue text.

Description

I ran into an issue with a monitoring tool that checks all the routes. It is failing on the session check because it's calling session_start(), even though that won't work from the CLI.

https://github.com/Pierstoval/SmokeTesting/issues/14

I think better would be to inject the RequestStack and get the session from there, and ignore the test if it fails or isn't available.

I realize that test is specifically about testing the session, and this is an edge case (calling the controller from a service that doesn't have a browser context).

Dominant language
PHP
Stars
7
Forks
2
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

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 OpenConext/Monitor-bundle

All issues in OpenConext/Monitor-bundle

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.