mirror of
https://github.com/logos-messaging/docs.waku.org.git
synced 2026-01-07 15:23:07 +00:00
1 line
5.8 KiB
JavaScript
1 line
5.8 KiB
JavaScript
|
|
"use strict";(self.webpackChunkwaku_guide=self.webpackChunkwaku_guide||[]).push([[9990],{28453:(e,n,i)=>{i.d(n,{R:()=>o,x:()=>c});var t=i(96540);const s={},r=t.createContext(s);function o(e){const n=t.useContext(r);return t.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:o(e.components),t.createElement(r.Provider,{value:n},e.children)}},98286:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>u,contentTitle:()=>d,default:()=>h,frontMatter:()=>a,metadata:()=>t,toc:()=>l});const t=JSON.parse('{"id":"guides/js-waku/manage-filter","title":"Manage Your Filter Subscriptions","description":"This guide provides detailed steps to manage Filter subscriptions and handle node disconnections in your application. Have a look at the Send and Receive Messages Using Light Push and Filter guide for using the Light Push and Filter protocols.","source":"@site/docs/guides/js-waku/manage-filter.md","sourceDirName":"guides/js-waku","slug":"/guides/js-waku/manage-filter","permalink":"/guides/js-waku/manage-filter","draft":false,"unlisted":false,"editUrl":"https://github.com/waku-org/docs.waku.org/tree/develop/docs/guides/js-waku/manage-filter.md","tags":[],"version":"current","lastUpdatedAt":null,"frontMatter":{"title":"Manage Your Filter Subscriptions","hide_table_of_contents":true},"sidebar":"guides","previous":{"title":"Debug Your Waku DApp and WebSocket","permalink":"/guides/js-waku/debug-waku-dapp"},"next":{"title":"Frequently Asked Questions","permalink":"/guides/js-waku/faq"}}');var s=i(74848),r=i(28453);function o(e){const n={mermaid:"mermaid",...(0,r.R)(),...e.components};return(0,s.jsx)(n.mermaid,{value:"graph TD\n A[Start Monitoring Filter Subscriptions] --\x3e B{Check Peer Connection}\n B -- Connected --\x3e C[Send Ping]\n C --\x3e D{Ping Success?}\n D -- Yes --\x3e B\n D -- No --\x3e E[Handle Error/Reinitiate Subscription]\n B -- Disconnected --\x3e F[Check Intentional Disconnection/Unsubscription]\n F -- Yes --\x3e G[Stop Monitoring]\n F -- No --\x3e B\n E --\x3e B"})}function c(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(o,{...e})}):o(e)}const a={title:"Manage Your Filter Subscriptions",hide_table_of_contents:!0},d=void 0,u={},l=[{value:"Overview",id:"overview",level:2},{value:"Pinging filter subscriptions",id:"pinging-filter-subscriptions",level:2}];function p(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",p:"p",pre:"pre",...(0,r.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:["This guide provides detailed steps to manage ",(0,s.jsx)(n.a,{href:"/learn/concepts/protocols#filter",children:"Filter"})," subscriptions and handle node disconnections in your application. Have a look at the ",(0,s.jsx)(n.a,{href:"/guides/js-waku/light-send-receive",children:"Send and Receive Messages Using Light Push and Filter"})," guide for using the ",(0,s.jsx)(n.code,{children:"Light Push"})," and ",(0,s.jsx)(n.code,{children:"Filter"})," protocols."]}),"\n",(0,s.jsx)(n.h2,{id:"overview",children:"Overview"}),"\n",(0,s.jsxs)(n.p,{children:["Occasionally, your ",(0,s.jsx)(n.code,{children:"Filter"})," subscriptions might disconnect from the Waku Network, resulting in messages not being received by your application. To manage your subscriptions, periodically ping peers to check for an active connection. The error message ",(0,s.jsx)(n.code,{children:'"peer has no subscriptions"'})," indicates a failed ping due to disconnection. You can stop the pings if the disconnection/unsubscription is deliberate."]}),"\n","\n",(0,s.jsx)(c,{}),"\n",(0,s.jsx)(n.h2,{id:"pinging-filter-subscriptions",children:"Pinging filter subscriptions"}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.code,{children:"@waku/sdk"})," package provides a ",(0,s.jsx)(n.code,{children:"Filter.ping()"})," function to ping subscriptions and check for an active connection. To begin, create a ",(0,s.jsx)(n.code,{children:"Filter"}),
|