Skip to content
New issue

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

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

Already on GitHub? # to your account

Access CAP Times Losing Keys #406

Closed
jaswrks opened this issue Dec 12, 2014 · 3 comments
Closed

Access CAP Times Losing Keys #406

jaswrks opened this issue Dec 12, 2014 · 3 comments

Comments

@jaswrks
Copy link
Contributor

jaswrks commented Dec 12, 2014

As you can see in this log, keys are being replaced accidentally when multiple CCAPS are added in succession by a single process. The time() increment of 0001 is not enough to prevent this whenever the hook is fired successively, where the current timestamp is the same across multiple calls.

Array
(
    [prev] => Array
        (
            [subscriber] => 1
            [access_s2member_ccap_pro] => 1
            [access_s2member_ccap_unlimited] => 1
        )

    [now] => Array
        (
            [subscriber] => 1
            [access_s2member_ccap_unlimited] => 1
        )

)
Array
(
    [prev] => Array
        (
            [ccap_pro] => 1
            [ccap_unlimited] => 1
            [level0] => 1
        )

    [now] => Array
        (
            [ccap_unlimited] => 1
            [level0] => 1
        )

)
Array
(
    [1418412438.0001] => ccap_unlimited
    [1418412438.0002] => level1
    [1418412451.0001] => -level1
    [1418423242.0001] => ccap_unlimited
    [1418423248.0001] => -ccap_unlimited
    [1418423276.0001] => ccap_unlimited
    [1418423497.0001] => ccap_unlimited
    [1418423516.0001] => ccap_unlimited
    [1418425234.0001] => ccap_unlimited
    [1418425417.0001] => ccap_unlimited
    [1418427457.0001] => -ccap_pro
)
Array
(
    [prev] => Array
        (
            [subscriber] => 1
            [access_s2member_ccap_unlimited] => 1
        )

    [now] => Array
        (
            [subscriber] => 1
        )

)
Array
(
    [prev] => Array
        (
            [ccap_unlimited] => 1
            [level0] => 1
        )

    [now] => Array
        (
            [level0] => 1
        )

)
Array
(
    [1418412438.0001] => ccap_unlimited
    [1418412438.0002] => level1
    [1418412451.0001] => -level1
    [1418423242.0001] => ccap_unlimited
    [1418423248.0001] => -ccap_unlimited
    [1418423276.0001] => ccap_unlimited
    [1418423497.0001] => ccap_unlimited
    [1418423516.0001] => ccap_unlimited
    [1418425234.0001] => ccap_unlimited
    [1418425417.0001] => ccap_unlimited
    [1418427457.0001] => -ccap_unlimited
)
Array
(
    [prev] => Array
        (
            [subscriber] => 1
        )

    [now] => Array
        (
            [subscriber] => 1
            [access_s2member_ccap_pro] => 1
        )

)
Array
(
    [prev] => Array
        (
            [level0] => 1
        )

    [now] => Array
        (
            [ccap_pro] => 1
            [level0] => 1
        )

)
Array
(
    [1418412438.0001] => ccap_unlimited
    [1418412438.0002] => level1
    [1418412451.0001] => -level1
    [1418423242.0001] => ccap_unlimited
    [1418423248.0001] => -ccap_unlimited
    [1418423276.0001] => ccap_unlimited
    [1418423497.0001] => ccap_unlimited
    [1418423516.0001] => ccap_unlimited
    [1418425234.0001] => ccap_unlimited
    [1418425417.0001] => ccap_unlimited
    [1418427457.0001] => ccap_pro
)
Array
(
    [prev] => Array
        (
            [subscriber] => 1
            [access_s2member_ccap_pro] => 1
        )

    [now] => Array
        (
            [subscriber] => 1
            [access_s2member_ccap_pro] => 1
            [access_s2member_ccap_unlimited] => 1
        )

)
Array
(
    [prev] => Array
        (
            [ccap_pro] => 1
            [level0] => 1
        )

    [now] => Array
        (
            [ccap_pro] => 1
            [ccap_unlimited] => 1
            [level0] => 1
        )

)
Array
(
    [1418412438.0001] => ccap_unlimited
    [1418412438.0002] => level1
    [1418412451.0001] => -level1
    [1418423242.0001] => ccap_unlimited
    [1418423248.0001] => -ccap_unlimited
    [1418423276.0001] => ccap_unlimited
    [1418423497.0001] => ccap_unlimited
    [1418423516.0001] => ccap_unlimited
    [1418425234.0001] => ccap_unlimited
    [1418425417.0001] => ccap_unlimited
    [1418427457.0001] => ccap_unlimited
)

@jaswrks
Copy link
Contributor Author

jaswrks commented Dec 12, 2014

Key 1418427457.0001 goes from containing ccap_pro, to finally being replaced entirely by ccap_unlimited. This is causing a loss of data.

jaswrks pushed a commit that referenced this issue Dec 12, 2014
Bug fix access cap times loss of precision. See: #406
@jaswrks jaswrks closed this as completed Dec 13, 2014
@jaswrks
Copy link
Contributor Author

jaswrks commented Dec 13, 2014

Next Release Changelog:

  • (s2Member/s2Member Pro) Bug fix s2Member's membership access times log was failing to collect all required access times under certain scenarios where multiple CCAPS were being added or removed in succession within the same process, but across multiple function calls. This resulted in unexpected behaviors (in rare cases) when attempting to use the [s2Drip /] shortcode. Fixed in this release. See this GitHub issue for technical details.

@clavaque
Copy link
Contributor

👍

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants