apache / superset

Apache Superset is a Data Visualization and Data Exploration Platform
https://superset.apache.org/
Apache License 2.0
62.71k stars 13.85k forks source link

[explore] severe regression: ADD TO DASHBOARD refers to wrong chart origin dashboard #16964

Closed rumbin closed 3 years ago

rumbin commented 3 years ago

Editing two charts of two different dashboards in a row can lead to having the Save Chart dialog refering to the wrong chart origin, i.e., to the dashboard where the formerly edited chart originated from.

How to reproduce the bug

  1. Go to the list of Dashboards (or xour personal favorites)
  2. Select any dashboard
  3. Pick any chart of the dashboard and click View in Explore
  4. Edit the chart a bit
  5. Click Save
  6. keep the default settings (overwrite...) of the save dialog
  7. notice that the ADD TO DASHBOARD field is correctly refering to the dashboard where the chart originates from
  8. Click SAVE & GO TO DASHBOARD
  9. Now repeat step 1…6, but select a different dashboard and a different chart from this dashboard
  10. Instead of step 7, notice that now the ADD TO DASHBOARD is still refering to the dashboard of step 2
  11. Click SAVE & GO TO DASHBOARD
  12. Notice that you really ended up on the dashboard of step 2 instead of the one of step 9.

Expected results

Anytime a chart is being edited via the View in Explore menu item of a dashboard, the save dialog suggests to overwrite/replace the chart within this very dashboard.

This used to be the default behavior for a long tome and was working flawlessly at least up to Superset 1.0.1

Actual results

  1. It may happen that the save dialog suggests a different dashboard while overwriting the chart. The dashboard that is accidentally suggested is the one that was the origin of the chart that was edited right beforehand.
  2. Not sure how reproducible this is altogether, but I managed to record it and it seems that at least this workflow is fairly "stable".
  3. Opening the Explore in a new browser tabl and/or F5-refreshing the page may lead to the correct behavior, I suppose.

Screenshots/Screencasts

saving_to_wrong_chart_origin_dashboard

Environment

Checklist

Additional context

´pip freeze´

aiohttp==3.7.4.post0
alembic==1.7.3
amqp==2.6.1
apache-superset==1.3.1
apispec==3.3.2
asn1crypto==1.4.0
async-timeout==3.0.1
attrs==21.2.0
azure-common==1.1.27
azure-core==1.18.0
azure-storage-blob==12.9.0
Babel==2.9.1
backoff==1.11.1
billiard==3.6.4.0
bleach==3.3.1
boto3==1.18.51
botocore==1.21.51
Brotli==1.0.9
cachelib==0.1.1
cachetools==4.2.4
celery==4.4.7
certifi==2021.5.30
cffi==1.14.6
chardet==4.0.0
charset-normalizer==2.0.6
click==7.1.2
cmdstanpy==0.9.68
colorama==0.4.4
convertdate==2.3.2
cron-descriptor==1.2.24
croniter==1.0.15
cryptography==3.4.8
cx-Oracle==8.2.1
cycler==0.10.0
Cython==0.29.24
defusedxml==0.7.1
deprecation==2.1.0
dnspython==2.1.0
elasticsearch==7.13.4
elasticsearch-dbapi==0.2.6
email-validator==1.1.3
ephem==4.1
et-xmlfile==1.1.0
Flask==1.1.4
Flask-AppBuilder==3.3.3
Flask-Babel==1.0.0
Flask-Caching==1.10.1
Flask-Compress==1.10.1
Flask-JWT-Extended==3.25.1
Flask-Login==0.4.1
Flask-Migrate==3.1.0
Flask-OpenID==1.3.0
Flask-SQLAlchemy==2.5.1
flask-talisman==0.8.1
Flask-WTF==0.14.3
future==0.18.2
geographiclib==1.52
geopy==2.2.0
gevent==21.8.0
google-api-core==2.0.1
google-auth==2.2.1
google-cloud-bigquery==2.27.1
google-cloud-core==2.0.0
google-crc32c==1.2.0
google-resumable-media==2.0.3
googleapis-common-protos==1.53.0
graphlib-backport==1.0.3
greenlet==1.1.2
grpcio==1.41.0
gunicorn==20.0.4
hdbcli==2.10.13
holidays==0.10.3
humanize==3.11.0
idna==3.2
importlib-resources==5.2.2
isodate==0.6.0
itsdangerous==1.1.0
Jinja2==2.11.3
jmespath==0.10.0
jsonschema==3.2.0
kiwisolver==1.3.2
kombu==4.6.11
korean-lunar-calendar==0.2.1
LunarCalendar==0.0.9
Mako==1.1.5
Markdown==3.3.4
MarkupSafe==2.0.1
marshmallow==3.13.0
marshmallow-enum==1.5.1
marshmallow-sqlalchemy==0.23.1
matplotlib==3.4.3
msgpack==1.0.2
msrest==0.6.21
multidict==5.1.0
numpy==1.21.2
oauthlib==3.1.1
openpyxl==3.0.9
oscrypto==1.2.1
packaging==21.0
pandas==1.2.5
parsedatetime==2.6
pgsanity==0.2.9
Pillow==8.3.2
polyline==1.4.0
prison==0.2.1
prophet==1.0
proto-plus==1.19.2
protobuf==3.18.0
psycopg2-binary==2.8.6
pyarrow==4.0.1
pyasn1==0.4.8
pyasn1-modules==0.2.8
pybigquery==0.10.2
pycparser==2.20
pycryptodomex==3.10.4
pyhdb==0.3.4
PyJWT==1.7.1
PyMeeus==0.5.11
pyOpenSSL==20.0.1
pyparsing==2.4.7
pyrsistent==0.18.0
pystan==2.18.0.0
python-dateutil==2.8.2
python-dotenv==0.19.0
python-geohash==0.8.5
python-ldap==3.3.1
python3-openid==3.2.0
pytz==2021.1
PyYAML==5.4.1
redis==3.5.3
requests==2.26.0
requests-oauthlib==1.3.0
rsa==4.7.2
s3transfer==0.5.0
selenium==3.141.0
setuptools-git==1.2
simplejson==3.17.5
six==1.16.0
slackclient==2.5.0
snowflake-connector-python==2.6.2
snowflake-sqlalchemy==1.2.4
SQLAlchemy==1.3.24
sqlalchemy-hana==0.5.0
SQLAlchemy-Utils==0.36.8
sqlparse==0.3.0
tabulate==0.8.9
tqdm==4.62.3
typing-extensions==3.10.0.2
ujson==4.2.0
urllib3==1.26.7
vine==1.3.0
webencodings==0.5.1
Werkzeug==1.0.1
WTForms==2.3.3
WTForms-JSON==0.3.3
xlrd==2.0.1
yarl==1.6.3
zipp==3.6.0
zope.event==4.5.0
zope.interface==5.4.0
rumbin commented 3 years ago

I am experiencing quite similar behavior when issuing the Schedule Email Report button on two different dashboards subsequently. In this case it can happen that the New Email report dialog does not open, but the Email reports active pop-up is shown, which in turn refers to the report of the former dashboard instead of the currently viewed dashboard.

Unfortunately, I am now failing to reproduce this, although it "worked" several times before trying to record the screencast. So, debugging will be tricky, I guess.

rumbin commented 3 years ago

Debugging:

I deactivated all these feature flags temporarily, ran superset init and could still reproduce the issue:

    "ALERTS_ATTACH_REPORTS": False,
    "DASHBOARD_NATIVE_FILTERS": False, 
    "DASHBOARD_CROSS_FILTERS": False,
    "DASHBOARD_NATIVE_FILTERS_SET": False,
    "ENABLE_EXPLORE_DRAG_AND_DROP": False,
    "DASHBOARD_CACHE": False   
junlincc commented 3 years ago

@rumbin thanks for the details! to confirm, you ARE ABLE TO reproduce this issue with the above FeatureFlags on?

junlincc commented 3 years ago

@rumbin also 1. have you tried to reproduce it on dashboard that has NO filterboxes?

  1. have you tried editing charts by changing the query, instead of just the color scheme? is it still a proble? please let use know, thanks!
rumbin commented 3 years ago

@rumbin thanks for the details! to confirm, you ARE ABLE TO reproduce this issue with the above FeatureFlags on?

@junlincc Yes, the issue is present with both the abovementioned feature flags turned off an on, respectively. I also did execute superset init after toggling them.

rumbin commented 3 years ago

@rumbin also 1. have you tried to reproduce it on dashboard that has NO filterboxes? 2. have you tried editing charts by changing the query, instead of just the color scheme? is it still a proble? please let use know, thanks!

@junlincc I performed some more tests and varied many possible influences.

⇒ The issue is still present :-( saving_to_wrong_chart_origin_dashboard_test2_resized