From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Javier Olaechea Newsgroups: gmane.emacs.bugs Subject: bug#66144: 29.1; eglot-shutdown request params violate JSONRPC Date: Sat, 14 Oct 2023 11:59:03 -0500 Message-ID: References: <83bkd1sjr1.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000c8a4b40607b01777" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30385"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , 66144@debbugs.gnu.org To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 14 19:00:05 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qrhzh-0007hR-6c for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 14 Oct 2023 19:00:05 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qrhzJ-000430-H9; Sat, 14 Oct 2023 12:59:41 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qrhzH-00042g-Rc for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2023 12:59:39 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qrhzH-0003Gr-Jc for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2023 12:59:39 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qrhzf-0002KI-12 for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2023 13:00:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Javier Olaechea Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 14 Oct 2023 17:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66144 X-GNU-PR-Package: emacs Original-Received: via spool by 66144-submit@debbugs.gnu.org id=B66144.16973027888794 (code B ref 66144); Sat, 14 Oct 2023 17:00:02 +0000 Original-Received: (at 66144) by debbugs.gnu.org; 14 Oct 2023 16:59:48 +0000 Original-Received: from localhost ([127.0.0.1]:50305 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qrhzP-0002He-Qo for submit@debbugs.gnu.org; Sat, 14 Oct 2023 12:59:48 -0400 Original-Received: from mail-yw1-x1133.google.com ([2607:f8b0:4864:20::1133]:60871) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qrhzM-0002FB-Bg for 66144@debbugs.gnu.org; Sat, 14 Oct 2023 12:59:45 -0400 Original-Received: by mail-yw1-x1133.google.com with SMTP id 00721157ae682-5a7c011e113so42184027b3.1 for <66144@debbugs.gnu.org>; Sat, 14 Oct 2023 09:59:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697302755; x=1697907555; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=tHbPJdhamM1uem0N1kjXFCTSYq/6280bGGPBchijfa0=; b=gzbRrPrMmWqXMXSlpdQvmRJKhFFfJB1neo7xpCwjWqzWzzjN5b+9+ACgRHp/0F3QSk iuFbeuwP4xbByNv4icbDzk+BQFgYe1Ef84eJ+QLXYPsiEkzles6cjy9ldQ7iWigMn9Lu Ivd7/yuM6PCPQ8YwiHfFAY5sOb+2y+XRxrjxIzS4ASMVaWj/aAAvjFO4X81CcNO/D1Gn vpb4+sUEq1NCPwqkMPfiLLJYoMlzFZ+q3KKwwmT9fIAJvxKgTc1neNfIbOsnJk1k2ue7 uG4AFpsKkIX5esDTrgXNFjzs8ML8Mbzmy4tFyduWHGp30N0XpDjvsueD1ICwaLlxQQSQ v1qQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697302755; x=1697907555; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=tHbPJdhamM1uem0N1kjXFCTSYq/6280bGGPBchijfa0=; b=QkhtxmVY3GDHoDTw468DyZ+MuHq9iY7YjCrUzPdR63etpkqPwyK8J9eXDkptm2JrMV HO+1uyWUVvt9rbR9+3OA0DlH1mgq7JyUfsL4PYKHnDvBJnfSVCG2Tgq/NgW8GiaiIieO /n8tckAHNYXTb5fuCo1r00tw11YHRpPHfH6jF8JwFYZ8IQcKx0JOfPVWZUfTEfedDJ3q X2ajHu73EW6bc4N57CjGQ4z5Mj7OkxiqsPKkPOnzM7pm0DnxXKQB69ajsytukt8bSspS e5iKUhVL/dAM7qa7d3fokGx5drRMcx9j3IBQOrXd3RHfW+mCK+QT3eEg6Bi4D6I/yt0J 2FPA== X-Gm-Message-State: AOJu0Yzz6gY6xZV2A7Bal8eAbzdilljNFYor5DWYu25UTtcX45gPh4qx 8cu4Cb8H3bJ6P4EMM8RzKuIrlBdB1+SprfJ5To0= X-Google-Smtp-Source: AGHT+IEc/ld+8wW5iHW21ZqiwGiCumj0nIUL/s3s7qTaC8VEadt1AnBKyBdshGaJL/7EZHMowWj61OR6lguXYkTydjc= X-Received: by 2002:a05:690c:ece:b0:5a8:286d:339e with SMTP id cs14-20020a05690c0ece00b005a8286d339emr5112748ywb.4.1697302754926; Sat, 14 Oct 2023 09:59:14 -0700 (PDT) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:272444 Archived-At: --000000000000c8a4b40607b01777 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable > Yes. What's the matter? What would the "fix" fix? That is illegal, as in against the JSON-RPC standard, to send a request with `params: null.`. Quoting section 4.2 from the JSON RPC spec linked by OP: > If present, parameters for the rpc call MUST be provided as a Structured value. Either by-position through an Array or by-name through an Object. That means in a request object can not have a param key, but if present it must be an Array or an Object. That said, upon further reflection I think the bug is in json-rpc not eglot. On Sat, Oct 14, 2023 at 3:59=E2=80=AFAM Jo=C3=A3o T=C3=A1vora wrote: > On Sat, Oct 14, 2023, 09:14 Eli Zaretskii wrote: > >> > From: Javier Olaechea >> > Date: Sat, 7 Oct 2023 22:42:47 -0500 >> > >> > It seems that eglot used to send an empty object as the params but it >> got replaced by null to appease >> > gopls. >> > >> > >> https://github.com/joaotavora/eglot/commit/4f6e152e1c5efc39a888f747ecca3= 13a58f4375e >> > >> > The fix would be replacing the call >> > (jsonrpc-request server :shutdown nil :timeout (or timeout 1.5)) >> > with >> > (jsonrpc-request server :shutdown eglot--{} :timeout (or timeout 1.5)) >> >> Jo=C3=A3o, any comments? >> > > Yes. What's the matter? What would the "fix" fix? > >> --=20 "I object to doing things that computers can do." =E2=80=94 Olin Shivers --000000000000c8a4b40607b01777 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
> Yes. What's the matter? What would= the "fix" fix?

That is illegal, as in against the J= SON-RPC standard, to send a request with `params: null.`. Quoting section 4= .2 from the JSON RPC spec linked by OP:

> If present, parameters = for the rpc call MUST be provided as a=20 Structured value. Either by-position through an Array or by-name through an Object.

That means in a request object can not have a para= m key, but if present it must be an Array or an Object.

That said, u= pon further reflection I think the bug is in json-rpc not eglot.
=

= On Sat, Oct 14, 2023 at 3:59=E2=80=AFAM Jo=C3=A3o T=C3=A1vora <joaotavora@gmail.com> wrote:
On Sat, O= ct 14, 2023, 09:14 Eli Zaretskii <eliz@gnu.org> wrote:
> From: Javier Olaechea <pirata@gmail.com&g= t;
> Date: Sat, 7 Oct 2023 22:42:47 -0500
>
> It seems that eglot used to send an empty object as the params but it = got replaced by null to appease
> gopls.
>
> h= ttps://github.com/joaotavora/eglot/commit/4f6e152e1c5efc39a888f747ecca313a5= 8f4375e
>
> The fix would be replacing the call
> (jsonrpc-request server :shutdown nil :timeout (or timeout 1.5))
> with
> (jsonrpc-request server :shutdown eglot--{} :timeout (or timeout 1.5))=

Jo=C3=A3o, any comments?

=
Yes. What's the matter? What would the "fi= x" fix?


--
"I objec= t to doing things that computers can do." =E2=80=94 Olin Shivers
--000000000000c8a4b40607b01777--