Flow.Launcher icon indicating copy to clipboard operation
Flow.Launcher copied to clipboard

BUG: JSON-RPC Plugin Parameter Send Issue with JsonRPCAction

Open iQuick opened this issue 3 years ago • 11 comments

image 当我返回的 Title 不变的情况下,JsonRPCAction 传递的 parameters 参数值会始终保存第一次接收到的值

iQuick avatar May 18 '22 09:05 iQuick

似乎parameter就是跟title是一样的?那title不变parameter也不会变吧

taooceros avatar May 18 '22 12:05 taooceros

@taooceros 上图是我根据这个问题调整后的

iQuick avatar May 19 '22 01:05 iQuick

之前我是这样写的

    def save_info(self, key, value):
        return [{
            "Title": "保存",
            "SubTitle": "save",
            "IcoPath": "icon.png",
            "JsonRPCAction": {
                "method": "save_to_database",
                "parameters": ["{},{}".format(key, value)]
            }
        }]

    def query(self, query):
        _args = query.split(" ")
        if len(_args) == 2:
            if _args[0] == "delete":
                return self.delete_key(_args[1])
            else:
                return self.save_info(_args[0], _args[1])
        return self.find_key(_args[0])

当我 title 始终保持是 “保存” 的时候,query 无论怎么更新,parameters 传递的始终是 save_info 第一次被调用时的值。

iQuick avatar May 19 '22 01:05 iQuick

我研究一下

taooceros avatar May 21 '22 06:05 taooceros

噢似乎是因为结果刷的太快最后一个被丢掉了?可能是一些race tracing的问题?你试试慢点打字

taooceros avatar May 21 '22 06:05 taooceros

我尝试过了,不是的。打字完后,停顿很久,parameters 一样没有更新。 感觉是 Title 或者 SubTitle 会组合作为 key 去存储 JsonRPCAction ,当 Title 或者 SubTitle 都不发生变化时,后面传递的 parameters 都会被忽略,不会更新。

iQuick avatar May 23 '22 06:05 iQuick

我会拿正式版再试一次

taooceros avatar May 23 '22 13:05 taooceros

我大概知道了,可能是cache的问题 感谢报告

taooceros avatar May 31 '22 18:05 taooceros

可能需要重新设计一下这个result的去重了

taooceros avatar May 31 '22 19:05 taooceros

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Jul 01 '22 02:07 github-actions[bot]

This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Aug 16 '22 02:08 github-actions[bot]