Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Config\App session items #7000

Closed
wants to merge 3 commits into from

Conversation

kenjis
Copy link
Member

@kenjis kenjis commented Dec 21, 2022

Needs #6998
Needs #7011

Description
Session should not depends on Config\App. See #4297 (comment)

  • remove Config\App session items
  • add property for Config\Session in Session

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@kenjis kenjis added bug Verified issues on the current code behavior or pull requests that will fix them breaking change Pull requests that may break existing functionalities 4.4 labels Dec 21, 2022
@kenjis kenjis marked this pull request as draft December 21, 2022 06:21

// DEPRECATED COOKIE MANAGEMENT
$this->cookiePath = $config->cookiePath ?? $this->cookiePath;
$this->cookieDomain = $config->cookieDomain ?? $this->cookieDomain;
$this->cookieSecure = $config->cookieSecure ?? $this->cookieSecure;
$this->cookieSameSite = $config->cookieSameSite ?? $this->cookieSameSite;

/** @var CookieConfig $cookie */
/** @var CookieConfig|null $cookie */
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems we can't remove the Session's dependency on the Config\App without first removing the cookie items in Config\App and making the Config\Cookie mandatory...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If everyone would be okay with removing session items from Config\App in 4.4, then I see no reason why we can't do the same with cookies.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I sent a PR #7011 to remove cookie items.
Would everyone be okay with removing items from Config\App in 4.4?

@kenjis kenjis force-pushed the remove-config-app-session branch 5 times, most recently from 7e63407 to 83cbf59 Compare December 22, 2022 08:20
@kenjis kenjis force-pushed the remove-config-app-session branch from 83cbf59 to d58f098 Compare December 22, 2022 08:23
Copy link
Member

@MGatner MGatner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we just need to start working on v5? All the stuff we have to break to get these components aligned is stacking.

@@ -105,26 +105,19 @@ abstract class BaseHandler implements SessionHandlerInterface
*/
protected $ipAddress;

public function __construct(AppConfig $config, string $ipAddress)
public function __construct(SessionConfig $session, string $ipAddress)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a pretty major change.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes and no. Almost no one writes their own session handlers, so in this particular case, the impact would be minimal. Although, I haven't thought of any other possible problems yet.

@michalsn
Copy link
Member

Sooner or later, v5 will come. It is more a question of where we want to draw the line. Will clearing the deprecated code and fixing some "bugs" will be enough to release v5, or are we hoping for some new features and major code rewrites?

Personally, I think that v5 doesn't have to be followed by some spectacular breakthrough. Fixing a few things and cleaning up the codebase would be enough.

@MGatner
Copy link
Member

MGatner commented Dec 24, 2022

@michalsn I don't disagree, but keep in mind that ultimately the major release cycle is governess by the CodeIgniter Foundation. While it's in a bit of a limbo, the last deliberation on the subject yielded a strong preference for keeping major releases to a minimum.

We've been able to accomplish a lot in v4 since it's release, but at the cost of lots of breaking changes. I don't want to take v5 lightly, because I don't want to be stuck bearing these same inconsistencies and tension between proper implementation and breaking releases.

I do think a focus on refactoring over new features makes sense for v5, since v4 and it's accompanying repos was so feature-focused.

@michalsn
Copy link
Member

@MGatner Of course, deciding when something will be released is not my role.

We have already deprecated many things in the codebase without giving any date for removing them. So common sense suggests that they will be removed in the next major version - not before. That's my only concern here.

I'm not against refactoring, but it would be nice to have some path/policy for removing deprecated features so that developers won’t be surprised that some feature is gone in the next minor release. Even announcing that deprecated functionality may disappear anytime would be okay.

@kenjis
Copy link
Member Author

kenjis commented Dec 25, 2022

I'm not against refactoring, but it would be nice to have some path/policy for removing deprecated features so that developers won’t be surprised that some feature is gone in the next minor release. Even announcing that deprecated functionality may disappear anytime would be okay.

I sent a PR #7021

@kenjis kenjis deleted the branch codeigniter4:4.3 January 10, 2023 06:36
@kenjis kenjis closed this Jan 10, 2023
@kenjis kenjis mentioned this pull request Feb 15, 2023
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.4 breaking change Pull requests that may break existing functionalities bug Verified issues on the current code behavior or pull requests that will fix them
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants