alist icon indicating copy to clipboard operation
alist copied to clipboard

在刷新令牌错误的情况下存储仍会被添加

Open 12189108 opened this issue 3 years ago • 4 comments

Please make sure of the following things

  • [x] I have read the documentation.
  • [x] I'm sure there are no duplicate issues or discussions.
  • [x] I'm sure it's due to alist and not something else(such as Dependencies or Operational).
  • [x] I'm sure I'm using the latest version

Alist Version / Alist 版本

v3.4.0

Driver used / 使用的存储驱动

阿里云盘

Describe the bug / 问题描述

在错误输入刷新令牌的情况下,尽管会提示The input parameter refresh_token is not valid,但它还是会被添加到存储列表中,并且添加页面不会不会关闭,然后你在此页面只修正刷新令牌并点击保存,则会提示Failed create storage in database: UNIQUE constraint failed: x_storages.mount_path。 应在验证刷新令牌有效的情况下才能将数据写入数据库。

Reproduction / 复现链接

捕获

Logs / 日志

No response

12189108 avatar Nov 13 '22 10:11 12189108

无法实现 因为需要先通过写入数据库以获取唯一id来继续后续操作。

之后会考虑在添加失败后自动转到编辑界面以避免此类错误。

xhofe avatar Nov 13 '22 11:11 xhofe

无法实现 因为需要先通过写入数据库以获取唯一id来继续后续操作。

之后会考虑在添加失败后自动转到编辑界面以避免此类错误。

那可以在写入数据库验证刷新令牌无效后,再直接从数据库中删除这条记录吗

12189108 avatar Nov 13 '22 11:11 12189108

不能 因为不是所有的错误都是不可用的。有可能会出现初始化错误但是可用的情况。

xhofe avatar Nov 13 '22 12:11 xhofe

Hello, this issue has been inactive for more than 30 days and will be closed if inactive for another 30 days.

github-actions[bot] avatar Jan 01 '23 00:01 github-actions[bot]