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

State saved in 'hash' should take precedence over 'local_storage' #545

Closed
maciex opened this Issue Dec 22, 2017 · 8 comments

Comments

2 participants
@maciex

maciex commented Dec 22, 2017

When state saving is enabled using hash and local_storage filter states should be restored from hash (if present), and then local_storage should be used,

This scenario applies to situations when one person send the URL to the table to the other people.
The person assumes all people will get the same result in the table, as all the filters are in the link.

Example config:

            state: {
                types: ['hash', 'local_storage'],
                filters: true,
                page_number: true,
                page_length: true,
                sort: true,
                columns_visibility: true,
                filters_visibility: true
            },

Reproduction steps:

I'll describe here how to reproduce the situation on one PC using two different browsers. But this happens between different systems also.
This is easily reproducible using one browser, but with different profiles (or Private Mode could be used).

  1. Using browser 1 (Firefox) set filter on column 1 to "AAAA"
  2. Using browser 2 (Chrome) set filter on column 2 to "BBBB"
  3. Copy and open the link from browser 1 (Firefox) to browser 2 (Chrome)

Expected behavior:
Browser 2 (Chrome) should show the same filters applied as in browser 1 (Firefox).
Column 1 filter is set to "AAAA"

Observed behavior:
Browser 2 (Chrome) shows locally saved filters.
Column 1 filter is set to "BBBB"

TableFilter version: v0.6.9
Browser and version: Firefox 57.0.2
OS and version: Fedora 27

Additional information:

  • Problem started happening recently, didn't happen in an older version of TableFilter:
    I don't know
  • Problem can be reliably reproduced, doesn't happen randomly: Yes

@maciex maciex changed the title from State saved in 'hash' should take precedence over 'local_storage to State saved in 'hash' should take precedence over 'local_storage' Dec 22, 2017

@koalyptus

This comment has been minimized.

Show comment
Hide comment
@koalyptus

koalyptus Dec 25, 2017

Owner

tx @maciex for pointing this out. I will try to include a fix in the next releases.

Owner

koalyptus commented Dec 25, 2017

tx @maciex for pointing this out. I will try to include a fix in the next releases.

@koalyptus koalyptus moved this from TODO to In Progress in Feature/UI/UX enhancements Dec 27, 2017

@koalyptus

This comment has been minimized.

Show comment
Hide comment
@koalyptus

koalyptus Dec 28, 2017

Owner

@maciex are you noticing the behaviour you described above with multiple selection filters (multiple, checklist)?
I am seeing expected behaviour for input and select types.

Owner

koalyptus commented Dec 28, 2017

@maciex are you noticing the behaviour you described above with multiple selection filters (multiple, checklist)?
I am seeing expected behaviour for input and select types.

@maciex

This comment has been minimized.

Show comment
Hide comment
@maciex

maciex Dec 28, 2017

I checked this behaviour on input, select and checklist and all of them seem to behave the same, every time there's something saved in local_storage it takes precedence over hash.

maciex commented Dec 28, 2017

I checked this behaviour on input, select and checklist and all of them seem to behave the same, every time there's something saved in local_storage it takes precedence over hash.

@koalyptus

This comment has been minimized.

Show comment
Hide comment
@koalyptus

koalyptus Jan 3, 2018

Owner

@maciex,
I added this example using v0.6.9 as per your configuration and followed the reproduction steps above (with other values) and the only filter which is misbehaving is the multiple type, which adds up the selections.
Can't reproduce the issue for checklist, select and input filter types.

TableFilter version: v0.6.9
Browser and version: Firefox 57.0.3 - Chrome Version 63.0.3239.84 - Microsoft Edge 41.16299.15.0
OS and version: Windows 10 Pro v1709

Owner

koalyptus commented Jan 3, 2018

@maciex,
I added this example using v0.6.9 as per your configuration and followed the reproduction steps above (with other values) and the only filter which is misbehaving is the multiple type, which adds up the selections.
Can't reproduce the issue for checklist, select and input filter types.

TableFilter version: v0.6.9
Browser and version: Firefox 57.0.3 - Chrome Version 63.0.3239.84 - Microsoft Edge 41.16299.15.0
OS and version: Windows 10 Pro v1709

@maciex

This comment has been minimized.

Show comment
Hide comment
@maciex

maciex Jan 5, 2018

Thanks for the example. Now I was able to prepare tests to show the problem.
Both tests are similar, the only difference is in the Chrome part. First we open the URL in the same tab as already opened table. Second we open new/empty tab.

Test 1

  1. Open Example Multiple State Types in Firefox

  2. Clear filters

  3. Set filters for columns:

    • Column 1: Benin
    • Column 2: BEN
    • Column 3: 1998
  4. Open Example Multiple State Types in Chrome

  5. Clear filters

  6. Set filters for columns:

    • Column 4: 145555.01
  7. Copy link from Firefox to Chrome and paste into the same tab example is already opened.

  8. Press enter

Expected result:

Following column filters should be set:

  • Column 1: Benin
  • Column 2: BEN
  • Column 3: 1998

Actual result:

Following column filters are set:

  • Column 1: Benin
  • Column 2: BEN
  • Column 3: 1998
  • Column 4: 145555.01

Test 2

(same as Test 1 but step 8 is different)

  1. Open Example Multiple State Types in Firefox

  2. Clear filters

  3. Set filters for columns:

    • Column 1: Benin
    • Column 2: BEN
    • Column 3: 1998
  4. Open Example Multiple State Types in Chrome

  5. Clear filters

  6. Set filters for columns:

    • Column 4: 145555.01
  7. Copy link from Firefox to Chrome and paste into the new tab.

  8. Press enter

Expected result:

Following column filters should be set:

  • Column 1: Benin
  • Column 2: BEN
  • Column 3: 1998

Actual result:

Following column filters are set:

  • Column 4: 145555.01

maciex commented Jan 5, 2018

Thanks for the example. Now I was able to prepare tests to show the problem.
Both tests are similar, the only difference is in the Chrome part. First we open the URL in the same tab as already opened table. Second we open new/empty tab.

Test 1

  1. Open Example Multiple State Types in Firefox

  2. Clear filters

  3. Set filters for columns:

    • Column 1: Benin
    • Column 2: BEN
    • Column 3: 1998
  4. Open Example Multiple State Types in Chrome

  5. Clear filters

  6. Set filters for columns:

    • Column 4: 145555.01
  7. Copy link from Firefox to Chrome and paste into the same tab example is already opened.

  8. Press enter

Expected result:

Following column filters should be set:

  • Column 1: Benin
  • Column 2: BEN
  • Column 3: 1998

Actual result:

Following column filters are set:

  • Column 1: Benin
  • Column 2: BEN
  • Column 3: 1998
  • Column 4: 145555.01

Test 2

(same as Test 1 but step 8 is different)

  1. Open Example Multiple State Types in Firefox

  2. Clear filters

  3. Set filters for columns:

    • Column 1: Benin
    • Column 2: BEN
    • Column 3: 1998
  4. Open Example Multiple State Types in Chrome

  5. Clear filters

  6. Set filters for columns:

    • Column 4: 145555.01
  7. Copy link from Firefox to Chrome and paste into the new tab.

  8. Press enter

Expected result:

Following column filters should be set:

  • Column 1: Benin
  • Column 2: BEN
  • Column 3: 1998

Actual result:

Following column filters are set:

  • Column 4: 145555.01
@koalyptus

This comment has been minimized.

Show comment
Hide comment
@koalyptus

koalyptus Jan 7, 2018

Owner

Tx @maciex for your detailed instructions, I will try to provide a fix shortly.

Owner

koalyptus commented Jan 7, 2018

Tx @maciex for your detailed instructions, I will try to provide a fix shortly.

@koalyptus koalyptus referenced this issue Jan 7, 2018

Merged

545 state persistence type precedence #553

7 of 7 tasks complete
@koalyptus

This comment has been minimized.

Show comment
Hide comment
@koalyptus

koalyptus Jan 8, 2018

Owner

Hi @maciex, v0.6.13 should fix above inconsistency, tell me how it goes.
I have updated http://koalyptus.github.io/TableFilter/multiple-state-types.html to point to the latest version of TableFilter so it can manually be tested on that example.

Cheers

Owner

koalyptus commented Jan 8, 2018

Hi @maciex, v0.6.13 should fix above inconsistency, tell me how it goes.
I have updated http://koalyptus.github.io/TableFilter/multiple-state-types.html to point to the latest version of TableFilter so it can manually be tested on that example.

Cheers

@maciex

This comment has been minimized.

Show comment
Hide comment
@maciex

maciex Jan 8, 2018

I did few quick tests and it is working as expected.
Great!

maciex commented Jan 8, 2018

I did few quick tests and it is working as expected.
Great!

@koalyptus koalyptus reopened this Jan 9, 2018

@koalyptus koalyptus closed this Jan 18, 2018

@koalyptus koalyptus moved this from In Progress to In QA in Feature/UI/UX enhancements Feb 28, 2018

@koalyptus koalyptus moved this from In QA to DONE in Feature/UI/UX enhancements Feb 28, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment