<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Tue</title>
    <description>The latest articles on DEV Community by Tue (@tuenguyen2911_67).</description>
    <link>https://dev.to/tuenguyen2911_67</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F701155%2F6191e9f6-a646-4c56-af87-95cc0646ae8d.jpg</url>
      <title>DEV Community: Tue</title>
      <link>https://dev.to/tuenguyen2911_67</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tuenguyen2911_67"/>
    <language>en</language>
    <item>
      <title>Socket event listener fires multiple times in React component</title>
      <dc:creator>Tue</dc:creator>
      <pubDate>Mon, 27 Jun 2022 03:53:36 +0000</pubDate>
      <link>https://dev.to/tuenguyen2911_67/socket-event-listener-fires-multiple-times-in-react-component-536o</link>
      <guid>https://dev.to/tuenguyen2911_67/socket-event-listener-fires-multiple-times-in-react-component-536o</guid>
      <description>&lt;p&gt;Here is something I've learned doing my side project that I think it's fundamental but also often overlooked. &lt;/p&gt;

&lt;h2&gt;
  
  
  Some context
&lt;/h2&gt;

&lt;p&gt;The project simply contains 2 major parts: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Front-end: React and Materials UI&lt;/li&gt;
&lt;li&gt;Back-end: REST API using Express, Typescript, Firebase and Socket.io&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;My goal was to inform the front-end when data is updated using Socket.io so that it would try to fetch data again. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/efk0JePDdPk7kmPnJR/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/efk0JePDdPk7kmPnJR/giphy.gif" width="480" height="270"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Incorrect attempts
&lt;/h2&gt;

&lt;p&gt;I had these incorrect code snippets that listen to socket event and fetch data again&lt;/p&gt;

&lt;p&gt;My first attempt was this, whenever there's any re-render, &lt;code&gt;socket.on('USER_JOINED')&lt;/code&gt; would registers the same &lt;code&gt;callback&lt;/code&gt; function passed into it so once the event &lt;code&gt;USER_JOINED&lt;/code&gt; is emitted, the same callback will fire multiple times while we only need it to execute once to reduce api calls and performance obviously.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Expense&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;initialValues&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setInitialValues&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;expense&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setExpense&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;socket&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;toLogIn&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useContext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;SWContext&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="c1"&gt;// ...&lt;/span&gt;
  &lt;span class="nx"&gt;socket&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;on&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;USER_JOINED&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;socketData&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// fetch data again&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;My second attempt was to register the callback once when the component is mounted but I still experienced multiple callback executions. It's because even after the component is unmounted, the callback is still registered with &lt;code&gt;socket&lt;/code&gt; (I use one single instance of socket (Singleton pattern)). And I wouldn't have access to new state if the state was updated.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;  &lt;span class="nx"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;socket&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;once&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;USER_JOINED&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;socketData&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="c1"&gt;// fetch data again&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;[]);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Solution
&lt;/h2&gt;

&lt;p&gt;This is what works for me so far. I register a socket event handler and a clean up &lt;code&gt;socket.off&lt;/code&gt; every time &lt;code&gt;expense&lt;/code&gt; changes. This way there's only one socket event handler being called at a time and detached when not needed&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;  &lt;span class="nx"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;socket&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;once&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;USER_JOINED&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;socketData&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="c1"&gt;// fetch data again&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;socket&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;off&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;USER_JOINED&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;expense&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I imagine this practice can also apply for similar situations like &lt;code&gt;window.addeventlistener()&lt;/code&gt;&lt;/p&gt;




&lt;p&gt;Take a look at my project if you're curious &lt;a href="https://github.com/TueeNguyen/SplitWise3"&gt;https://github.com/TueeNguyen/SplitWise3&lt;/a&gt;&lt;/p&gt;

</description>
      <category>socket</category>
      <category>react</category>
      <category>javascript</category>
    </item>
    <item>
      <title>3.0 release, work is not yet done</title>
      <dc:creator>Tue</dc:creator>
      <pubDate>Sat, 23 Apr 2022 04:15:41 +0000</pubDate>
      <link>https://dev.to/tuenguyen2911_67/30-release-work-is-not-yet-done-4mob</link>
      <guid>https://dev.to/tuenguyen2911_67/30-release-work-is-not-yet-done-4mob</guid>
      <description>&lt;p&gt;I exclusively worked on this issue this week &lt;a href="https://github.com/Seneca-CDOT/telescope/issues/3464"&gt;#3464&lt;/a&gt;. &lt;/p&gt;

&lt;h2&gt;
  
  
  Update Feed in &lt;code&gt;parser&lt;/code&gt; to use Supabase:
&lt;/h2&gt;

&lt;p&gt;I basically removed all &lt;code&gt;invalid&lt;/code&gt; and &lt;code&gt;flagged&lt;/code&gt; feed from &lt;a href="https://github.com/Seneca-CDOT/telescope/blob/master/src/api/parser/src/utils/storage.js"&gt;&lt;code&gt;src/api/parser/utils/storage&lt;/code&gt;&lt;/a&gt; and create functions that would take care of invalidating/flagging feeds using Supabase in &lt;a href="https://github.com/Seneca-CDOT/telescope/blob/master/src/api/parser/src/utils/storage.js"&gt;&lt;code&gt;src/api/parser/utils/supabase.js&lt;/code&gt;&lt;/a&gt;. Looking back, it wasn't that hard but it was quite lengthy.&lt;/p&gt;

&lt;p&gt;The difficulty was that &lt;a href="https://github.com/Seneca-CDOT/telescope/blob/72d20737f2ce1be2ea4c339ea99c36ecefdf563f/src/api/parser/src/utils/storage.js#L48-L75"&gt;this function&lt;/a&gt; uses &lt;code&gt;isFlagged&lt;/code&gt; function to check flagged feed and now it talks to Supabase instead of Redis which made unit test not pass without mocking it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;  &lt;span class="nx"&gt;addFeed&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;feed&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Check if feed being added already exists in flagged feeds set&lt;/span&gt;
    &lt;span class="c1"&gt;// If it is, do nothing&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;isFlagged&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;feed&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;createFeedKey&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;feed&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;redis&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;multi&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;hset&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;id&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="c1"&gt;// ...&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So I literally created a mock for Supabase database though I had a problem with telling Jest to use the mock module. &lt;/p&gt;

&lt;p&gt;Originally, I imported the mock this way&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;jest&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;mock&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../src/utils/supabase&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;__setMockFeeds&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;__resetMockFeeds&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../src/__mocks__/utils/supabase&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So, &lt;code&gt;__setMockFeeds&lt;/code&gt; would add the array to the actual module =&amp;gt; not the mock factory that Jest uses. Those 2 are different javascript objects and Jerry helped me understand this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Correct way to mock&lt;/span&gt;
&lt;span class="nx"&gt;jest&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;mock&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../src/utils/supabase&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;__setMockFeeds&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;__resetMockFeeds&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../src/utils/supabase&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I also had to reworked the parser e2e test, now it looks even simpler. For some reason, I kept forgetting to do &lt;code&gt;pnpm migrate&lt;/code&gt; and I was stuck on the test for a while. I managed to make it work a few hours before 3.0 release haha.&lt;/p&gt;




&lt;p&gt;However, work is not yet done, Supabase doesn't really work in production, &lt;code&gt;parser&lt;/code&gt; can't really talk to the database, I hope to fix this soon and earn myself some peace of mind. &lt;/p&gt;

</description>
      <category>javascript</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Pre 3.0</title>
      <dc:creator>Tue</dc:creator>
      <pubDate>Sat, 23 Apr 2022 02:55:43 +0000</pubDate>
      <link>https://dev.to/tuenguyen2911_67/pre-30-al7</link>
      <guid>https://dev.to/tuenguyen2911_67/pre-30-al7</guid>
      <description>&lt;p&gt;The closer we approaching release 3.0, the more we try to narrow the scope of work and honestly I like how each of us knows what area of focus to take charge on and trim down the excess issues. &lt;/p&gt;

&lt;p&gt;My tasks for this release again are mostly on &lt;code&gt;parser&lt;/code&gt; service:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Remove the src/backend&lt;/li&gt;
&lt;li&gt;Update invalid/flag feed functions to use Supabase&lt;/li&gt;
&lt;li&gt;Update docs after removing src/backend&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But let's focus on what I did the week prior to 3.0 release&lt;/p&gt;

&lt;h2&gt;
  
  
  Removing the src/backend:
&lt;/h2&gt;

&lt;p&gt;One of the problem I came across was that we passed in our staging &lt;code&gt;SUPABASE_URL&lt;/code&gt; and development &lt;code&gt;SERVICE_ROLE_KEY&lt;/code&gt; to &lt;code&gt;parser&lt;/code&gt;, the pair would never work and we'd never get staging &lt;code&gt;SERVICE_ROLE_KEY&lt;/code&gt; as it is a secret. I had to change the pair so that the client could work locally, this created another challenge. &lt;br&gt;
The reason we used staging url was Duke suggestion, he wanted to use the feeds from staging database instead of seeding feeds every time a developer spins up the services locally. Duke quickly wrote a solution to this in &lt;a href="https://github.com/Seneca-CDOT/telescope/pull/3541"&gt;#3541&lt;/a&gt; saving us from lengthy setup steps.&lt;/p&gt;

&lt;p&gt;This wasn't an easy task, I had to do a lot of detective work, I had to find out which microservice or module that used the legacy backend, luckily there weren't much. Removing dependencies was mundane too, I had to figure out which dependency in was peer dependency in the root &lt;code&gt;package.json&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;Deploying the code to production made me a bit anxious, it did break production because I did not consider the nginx proxy config for legacy backend so nginx kept breaking. See those locations removed in &lt;a href="https://github.com/Seneca-CDOT/telescope/pull/3550"&gt;#3550&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>opensource</category>
    </item>
    <item>
      <title>3.0.0-alpha.0</title>
      <dc:creator>Tue</dc:creator>
      <pubDate>Sat, 09 Apr 2022 02:30:20 +0000</pubDate>
      <link>https://dev.to/tuenguyen2911_67/300-alpha0-515</link>
      <guid>https://dev.to/tuenguyen2911_67/300-alpha0-515</guid>
      <description>&lt;p&gt;This release went quite smooth and FAST thanks to the recent docker changes, now we're pulling docker images instead of building them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Improve parser's e2e test:
&lt;/h2&gt;

&lt;p&gt;The problem was I loaded real feeds into the &lt;code&gt;feedQueue&lt;/code&gt; and made it download real resource through network requests. This approach wasn't correct and prone to random failures. David suggested me using the resources from &lt;a href="https://github.com/Seneca-CDOT/telescope/tree/master/src/web/test-web-content"&gt;&lt;code&gt;test-web-content&lt;/code&gt;&lt;/a&gt;. Looking back, I think I need to create another &lt;code&gt;xml&lt;/code&gt; feed, these feeds below are duplicate. &lt;a href="https://github.com/Seneca-CDOT/telescope/pull/3373"&gt;PR #3773&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;valid&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;author&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Tue Nguyen&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;http://localhost:8888/feed.xml&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;author&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Antonio Bennett&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;http://localhost:8888/feed.xml&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And for invalid feeds I just gave the queue non-existent feed urls&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;invalid&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;author&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;John Doe&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://johnhasinvalidfeed.com/feed&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;author&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Jane Doe&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://janehasinvalidfeed.com/feed&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Change parser to pull feeds from Supabase:
&lt;/h2&gt;

&lt;p&gt;I added &lt;code&gt;SUPABASE_URL&lt;/code&gt; &amp;amp; &lt;code&gt;ANON_KEY&lt;/code&gt; to &lt;code&gt;parser&lt;/code&gt; container for it to connect to the database and wrote a function that returns all feeds. &lt;a href="https://github.com/Seneca-CDOT/telescope/pull/3363"&gt;PR #3363&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;  &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nx"&gt;getAllFeeds&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;feeds&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;error&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;supabase&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;feeds&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;select&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;wiki_author_name, url&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;warn&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;error&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
      &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="nb"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;can't fetch feeds from supabase&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;formattedFeeds&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;feeds&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;feed&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt;
      &lt;span class="na"&gt;author&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;feed&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;wiki_author_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;feed&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;}));&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;formattedFeeds&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Some pieces of the tests had to be modified and &lt;code&gt;wiki parsing&lt;/code&gt; code was removed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Remove src/backend:
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/Seneca-CDOT/telescope/pull/3413"&gt;This one&lt;/a&gt; is huge but at least I didn't have to write new code 😅. Most of the work was to determine which part of the legacy &lt;code&gt;backend&lt;/code&gt; was still used by other services. Jerry helped me a lot with this PR, we went through files and found that &lt;code&gt;API_URL&lt;/code&gt; was still passed to services though, it had only one use in &lt;a href="https://github.com/Seneca-CDOT/telescope/blob/21bd9aafdc05c06ba2291bac2aba17e1659b288f/src/web/app/src/pages/_document.tsx#L36"&gt;&lt;code&gt;/src/web/app/src/pages/_document.tsx&lt;/code&gt;&lt;/a&gt;. &lt;br&gt;
The PR does work but there's still work to be done and tested.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I've learned doing reviews or looking at other PRs 😛:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;SWR react hook from &lt;a href="https://github.com/Seneca-CDOT/telescope/pull/3420"&gt;PR #3240&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Interesting way to solve the back up issue &lt;a href="https://github.com/Seneca-CDOT/telescope/pull/3405"&gt;PR #3405&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Use ORM to manage database change &lt;a href="https://github.com/Seneca-CDOT/telescope/pull/3418"&gt;PR #3418&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>opensource</category>
    </item>
    <item>
      <title>2nd time being Sheriff</title>
      <dc:creator>Tue</dc:creator>
      <pubDate>Tue, 05 Apr 2022 14:01:55 +0000</pubDate>
      <link>https://dev.to/tuenguyen2911_67/2nd-time-being-sheriff-64e</link>
      <guid>https://dev.to/tuenguyen2911_67/2nd-time-being-sheriff-64e</guid>
      <description>&lt;h2&gt;
  
  
  Sheriff duties:
&lt;/h2&gt;

&lt;p&gt;Last week, my sheriff duties were a bit different than usual. Aside from going over issues/PRs, assigning issues to people, I worked with &lt;a href="https://github.com/nguyenhung15913"&gt;Hung&lt;/a&gt; to group issues into different areas that we wanted to focus on for 3.0 alpha &lt;a href="https://github.com/Seneca-CDOT/telescope/wiki/Triage-Meeting-March-29,-2022-Preparing-for-Release-3.0-alpha"&gt;in the wiki&lt;/a&gt;. Moreover, with the help of other colleagues in the Thursday triage meeting, we went over the list of issues again and decided which one to go or stay in the project's milestone. I saw my growth in that session, I didn't know much about Telescope just 3 months ago and last week I knew which part of the project to be prioritize, shifted even to lower level in some parts I didn't work on, I gained the knowledge from doing reviews.&lt;/p&gt;

&lt;h2&gt;
  
  
  My contribution:
&lt;/h2&gt;

&lt;p&gt;I didn't do much in terms putting more code into the repo but I helped people move their code by doing reviews. One of the highlights last week was &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We finally deployed Supabase to production, hiding it behind an auth wall. This required changes to &lt;code&gt;docker&lt;/code&gt; and &lt;code&gt;nginx&lt;/code&gt; which were mostly done by &lt;a href="https://github.com/Seneca-CDOT/telescope/pull/3384"&gt;David&lt;/a&gt; and &lt;a href="https://github.com/Seneca-CDOT/telescope/pull/3098"&gt;Kevan&lt;/a&gt;. I need to read up on Kevan's work to understand &lt;code&gt;nginx&lt;/code&gt; implementation. &lt;/li&gt;
&lt;li&gt;We added a &lt;code&gt;secret.env&lt;/code&gt; file to live in staging and production &lt;/li&gt;
&lt;li&gt;Seeding feeds script to supabase &lt;/li&gt;
&lt;li&gt;We had some hiccups with the oAuth configs but they were &lt;a href="https://github.com/Seneca-CDOT/telescope/pull/3379"&gt;resolved quickly&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>opensource</category>
    </item>
    <item>
      <title>2.9 was exciting</title>
      <dc:creator>Tue</dc:creator>
      <pubDate>Sat, 26 Mar 2022 00:19:19 +0000</pubDate>
      <link>https://dev.to/tuenguyen2911_67/29-was-exciting-1no1</link>
      <guid>https://dev.to/tuenguyen2911_67/29-was-exciting-1no1</guid>
      <description>&lt;p&gt;This week I have the chance to spend more time and mind on Telescope since I don't have to worry about looking for an internship any more and this release has been productive and full of knowledge. &lt;/p&gt;

&lt;h2&gt;
  
  
  What have I done?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/Seneca-CDOT/telescope/pull/3040"&gt;My parser tests&lt;/a&gt; are finally done, thank you David for being patient with this task. I'm pretty sure that I close all connections that are open during the e2e test but something still hangs, I suspected that it comes from &lt;code&gt;[Bull]&lt;/code&gt;(&lt;a href="https://github.com/OptimalBits/bull"&gt;https://github.com/OptimalBits/bull&lt;/a&gt;) but it was hard to figure out what it actually was, therefore, I decided to &lt;code&gt;--forceExit&lt;/code&gt;[&lt;a href="https://jestjs.io/docs/cli"&gt;https://jestjs.io/docs/cli&lt;/a&gt;]&lt;/p&gt;

&lt;p&gt;After the tests were done, I &lt;a href="https://github.com/Seneca-CDOT/telescope/pull/3302"&gt;dockerized the parser service&lt;/a&gt;, it wasn't too hard as Kevan had done similar Dockerfile refactoring PRs and I had other images as an example. But I still took some time to understand what's going in those docker files. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Multi stage build, I guess it speeds up the process, it makes it easier to control data you want to pass to the image.&lt;/li&gt;
&lt;li&gt;User deterministic docker base image tags to achieve more stable build&lt;/li&gt;
&lt;li&gt;Don't execute Node.js app as root but use a &lt;code&gt;node&lt;/code&gt; (lower privilege user) to improve security and the command &lt;code&gt;--chown&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How I helped others and learned as well?
&lt;/h2&gt;

&lt;p&gt;Roxanne put an &lt;a href="https://github.com/Seneca-CDOT/telescope/pull/3301"&gt;autocomplete for authors PR&lt;/a&gt; which was very interesting, people were really responsive, it has 42 conversation in a few hours :D. It took me a while to learn what is n-gram, edge n-gram, how we need to the n-gram analyzer to index the database. I pretty much just raised some questions in the PR. Elasticsearch really is complicated, though Roxanne was able to answer most questions, kudo to you. This is also useful for my other project, it came just in time :D&lt;/p&gt;

&lt;p&gt;Francesco opened &lt;a href="https://github.com/Seneca-CDOT/telescope/pull/3281"&gt;a PR to implement copy button&lt;/a&gt;, I found it very interesting so I tried to play and make it work, I made some progress and sent a PR for Francesco to take some inspiration.&lt;/p&gt;

&lt;p&gt;I also reviewed some dependency discovery service pieces, I'm not exactly sure how it works yet, will need to talk to Jerry to help him with storing data through parser. Other than these PRs, I left my reviews in different PRs too. &lt;/p&gt;




&lt;p&gt;There were a lot of Docker movements the last few days, I want to catch up to them but I guess I need more fundamentals first&lt;/p&gt;

</description>
      <category>opensource</category>
    </item>
    <item>
      <title>Narrowing the work scope</title>
      <dc:creator>Tue</dc:creator>
      <pubDate>Thu, 17 Mar 2022 03:47:09 +0000</pubDate>
      <link>https://dev.to/tuenguyen2911_67/narrowing-the-work-scope-1ppf</link>
      <guid>https://dev.to/tuenguyen2911_67/narrowing-the-work-scope-1ppf</guid>
      <description>&lt;p&gt;We're only 2 releases away from 3.0 so we need to narrow the vision and focus on what we want to ship in 3.0 &lt;/p&gt;

&lt;h2&gt;
  
  
  What part do I own?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Well, I've been working on Parser exclusively, it's moving slower than I thought and I've hit &lt;a href="https://github.com/Seneca-CDOT/telescope/pull/3040"&gt;a road block&lt;/a&gt; where I can't get the Parser service to shutdown gracefully which affects Jest to not shutdown cleanly. &lt;/li&gt;
&lt;li&gt;I've also looked at and attempted implementing Supabase so I'll help Telescope to bring it to the front-end and rework Parser to use Supabase. To do this, I need to under the Docker pieces more essentially, we need to hide the Supabase studio behind Portainer (admin app for Docker containers). &lt;/li&gt;
&lt;li&gt;There's also a &lt;a href="https://github.com/Seneca-CDOT/telescope/pull/3137"&gt;PR&lt;/a&gt; I put up but there have been different opinions, let's see how we can solve it&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Foreseeable roadblocks:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;To this point, I'm not sure why my e2e test is not working properly, I think I'll ask a few people to join a call so that I can demonstrate the problem. &lt;/li&gt;
&lt;li&gt;I might need some time with Docker but I think I'm catching up quite quickly&lt;/li&gt;
&lt;li&gt;Communication between areas is actually very important and hard which is often overlooked, my Parser will be reworked to user Supabase, to serve Dependency Discovery's purpose. &lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>opensource</category>
    </item>
    <item>
      <title>Touching more Jest tests</title>
      <dc:creator>Tue</dc:creator>
      <pubDate>Sun, 13 Mar 2022 04:22:13 +0000</pubDate>
      <link>https://dev.to/tuenguyen2911_67/touching-more-jest-tests-27ph</link>
      <guid>https://dev.to/tuenguyen2911_67/touching-more-jest-tests-27ph</guid>
      <description>&lt;h2&gt;
  
  
  What've I contributed to 2.8
&lt;/h2&gt;

&lt;p&gt;I've had little impact this release. My parser service e2e test works but not perfect, it does test how valid and invalid feeds should be processed when added to the &lt;code&gt;feedQueue&lt;/code&gt; but this service doesn't shutdown gracefully. There are a few open handles that hangs Jest: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/Seneca-CDOT/telescope/blob/66c553d56450a51ba6170ae72aedf9dc2eec601e/src/api/parser/src/utils/indexer.js#L148-L157"&gt;setInterval()&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;timer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;reject&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;timerId&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;setTimeout&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;reject&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
          &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Unable to connect to Elasticsearch. Use `MOCK_ELASTIC=1` in your `.env` to mock Elasticsearch, or install (see https://github.com/Seneca-CDOT/telescope/blob/master/docs/environment-setup.md)&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="nx"&gt;DELAY&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;connectivity&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;intervalId&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;setInterval&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;checkConnection&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
        &lt;span class="nx"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;info&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Attempting to connect to elasticsearch...&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;

  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;race&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="nx"&gt;timer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;connectivity&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;

  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;clearInterval&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;intervalId&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;clearTimeout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;timerId&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The result of &lt;code&gt;Promise.race&lt;/code&gt; if all things are well should be a resolved Promise from &lt;code&gt;connectivity&lt;/code&gt;, after which is cleared by &lt;code&gt;clearInterval&lt;/code&gt;, somehow Jest still detects as open, this could be related to JavaScript event queue. I also tried using &lt;code&gt;unref()&lt;/code&gt; following &lt;a href="https://httptoolkit.tech/blog/unblocking-node-with-unref/#timeoutunref"&gt;Tim Perry's blog post&lt;/a&gt; but to a avail. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;logger&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Thanks to &lt;a href="https://github.com/Seneca-CDOT/telescope/pull/3178"&gt;David's PR&lt;/a&gt; turning logger off during test, this problem went away&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Redis&lt;/code&gt; open connections&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Some &lt;code&gt;Redis&lt;/code&gt; connections are still open after Jest finishes all tests, this was straightforward enough, I tried adding some code that keeps track of all open connections and close them after use and it worked but the logic already exist in Satellite, therefore, I wanted to reuse that code. Thanks to Francesco's work to merge Satellite to Telescope, adding anything to Satellite has become easier. &lt;/p&gt;

&lt;h2&gt;
  
  
  Modifying Satellite
&lt;/h2&gt;

&lt;p&gt;I opened a &lt;a href="https://github.com/Seneca-CDOT/telescope/pull/3162/files"&gt;PR&lt;/a&gt; to modify the &lt;code&gt;stop()&lt;/code&gt; from &lt;code&gt;Satellite&lt;/code&gt; class to close all database connections (ElasticSearch &amp;amp; Redis). However, I struggled more than I thought. &lt;/p&gt;

&lt;p&gt;First of all I changed &lt;code&gt;stop()&lt;/code&gt; to return an array of Promises, I used &lt;a href="https://nodejs.org/dist/latest-v8.x/docs/api/util.html"&gt;&lt;code&gt;promisify&lt;/code&gt;&lt;/a&gt; to make &lt;code&gt;server.close()&lt;/code&gt; return a Promise but it lost access to &lt;code&gt;this.server&lt;/code&gt; in Satellite so I had to bind it with &lt;code&gt;this.server&lt;/code&gt; instance.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;server&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;promisifiedClose&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;server&lt;/span&gt;
      &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="nx"&gt;promisify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;server&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;close&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;bind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;server&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
      &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One of my mistakes was not to pay attention to this piece of code&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;afterEach&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;service&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;stop&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Yes, the brackets are not needed, I should only return the Promise for Jest to wait. &lt;/p&gt;

&lt;p&gt;However, there's still problems with the service not shutting properly after the Satellite's change 😕&lt;/p&gt;

</description>
      <category>opensource</category>
    </item>
    <item>
      <title>Planning for release 2.8</title>
      <dc:creator>Tue</dc:creator>
      <pubDate>Sun, 27 Feb 2022 02:47:53 +0000</pubDate>
      <link>https://dev.to/tuenguyen2911_67/planning-for-release-28-55i3</link>
      <guid>https://dev.to/tuenguyen2911_67/planning-for-release-28-55i3</guid>
      <description>&lt;p&gt;This week, we talked to each other on what we were gonna work on for release 2.8. &lt;/p&gt;

&lt;p&gt;My plan is to finish the parser service, I'm struggling a bit with e2e tests but (Roxanne)[&lt;a href="https://github.com/rclee91"&gt;https://github.com/rclee91&lt;/a&gt;] offered me some help with changing the mocked &lt;code&gt;indexer&lt;/code&gt; to Elasticsearch mock, it became easier. &lt;/p&gt;

&lt;h3&gt;
  
  
  Writing e2e tests for parser:
&lt;/h3&gt;

&lt;p&gt;Most unit tests are written already, I just ported those tests over to &lt;code&gt;sr/api/parser&lt;/code&gt;, changed some imports and added a few small tests. &lt;/p&gt;

&lt;p&gt;My approach is to clear the redis database first and add a few feeds (invalid, valid, youtube) to the queue to process using a custom mocked &lt;code&gt;getWikiFeeds()&lt;/code&gt; and fetch &lt;code&gt;posts&lt;/code&gt; service to compare the result when the queue is drained. &lt;/p&gt;

&lt;p&gt;My mistake when trying to write e2e tests was that I tried to use mocked Redis, but e2e is where you test the flow of the application so mocking is not needed. I've got the first test to work but encountered this problem&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Jest did not exit one second after the test run has completed.

This usually means that there are asynchronous operations that weren't stopped in your tests. Consider running Jest with `--detectOpenHandles` to troubleshoot this issue.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I then ran the test with &lt;code&gt;--detectOpenHandles&lt;/code&gt; and found out that the code had a few Redis connections open, somehow &lt;code&gt;logger&lt;/code&gt; is an open handle, such as&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// src/api/parser/src/lib/queue.js&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Redis&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;subscriber&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Redis&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="c1"&gt;// /src/api/parser/src/utils/storage.js&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Redis&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@senecacdot/satellite&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;redis&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Redis&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I have something in mind, will update this blog when I find a solution! &lt;/p&gt;




&lt;p&gt;Personal notes: I hope the people of Ukraine can stay safe, I have a few Ukrainian friends and I can't imagine being in their shoes, it hurts me when thinking about it. The world has become unpredictable in the last 2 year.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>opensource</category>
    </item>
    <item>
      <title>First time being Sheriff</title>
      <dc:creator>Tue</dc:creator>
      <pubDate>Sat, 19 Feb 2022 16:49:50 +0000</pubDate>
      <link>https://dev.to/tuenguyen2911_67/first-time-being-sheriff-1obm</link>
      <guid>https://dev.to/tuenguyen2911_67/first-time-being-sheriff-1obm</guid>
      <description>&lt;p&gt;Oh, not that Sheriff guys, this &lt;a href="https://github.com/Seneca-CDOT/telescope/wiki/How-to-be-a-Sheriff"&gt;Sheriff&lt;/a&gt;. On the side note, I seriously need to add things I've learned to a list to remind myself.&lt;/p&gt;

&lt;h2&gt;
  
  
  Being sheriff
&lt;/h2&gt;

&lt;p&gt;I was a lot of work for sure, I had to manage the repo, move issues/PRs forward, assign them to the right people, reorganize milestones, and I went even further reviewing most of the PRs submitted this week. Here's what I've learnt: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;React Context through &lt;a href="https://github.com/Seneca-CDOT/telescope/pull/2947"&gt;Diana's PR&lt;/a&gt;, and a chance to look at &lt;a href="https://github.com/Seneca-CDOT/telescope/pull/2764"&gt;Abdul's PR&lt;/a&gt; on React custom hooks that I didn't look&lt;/li&gt;
&lt;li&gt;How does Telescope use JWT to authenticate &lt;/li&gt;
&lt;li&gt;How does auto deployment server &lt;a href="https://github.com/Seneca-CDOT/telescope/pull/2863"&gt;inject variables&lt;/a&gt; that are only determined during run time&lt;/li&gt;
&lt;li&gt;How do we &lt;a href="https://github.com/Seneca-CDOT/telescope/issues/2736"&gt;use turbo repo&lt;/a&gt; in telescope, and plan to transform and manage Telescope as a monorepo&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And of course, gained more knowledge on how Telescope works as a whole. &lt;/p&gt;

&lt;p&gt;The hardest part wasn't reviewing work from other contributors (though it was hard reading and understanding them), it was organizing issues and PRs into correct milestones, there were a lot of them :D. &lt;/p&gt;

&lt;h2&gt;
  
  
  Breaking production
&lt;/h2&gt;

&lt;p&gt;We can't seem to just have a zero in our version number 😃. There were a number of bugs but one of them was critical. We're changing the way both Satellite and Telescope use &lt;code&gt;JWT&lt;/code&gt; because we've introduced Supabase to our project. Basically, we changed Satellite to use &lt;code&gt;JWT_SECRET&lt;/code&gt; instead of &lt;code&gt;SECRET&lt;/code&gt; but &lt;a href="https://github.com/Seneca-CDOT/telescope/pull/2957"&gt;Joel's PR&lt;/a&gt; forgot to change the variables in &lt;code&gt;env.staging&lt;/code&gt; and &lt;code&gt;env.production&lt;/code&gt; which resulted in this error&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  if (!options || !options.secret) throw new Error('secret should be set');
                                   ^

Error: secret should be set
    at module.exports (/home/node/app/node_modules/express-jwt/lib/index.js:20:42)
    at isAuthenticated (/home/node/app/node_modules/@senecacdot/satellite/src/middleware.js:8:10)
    at Object.&amp;lt;anonymous&amp;gt; (/home/node/app/src/routes/register.js:17:3)
    at Module._compile (node:internal/modules/cjs/loader:1103:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.&amp;lt;anonymous&amp;gt; (/home/node/app/src/routes/index.js:8:25)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  My contribution:
&lt;/h2&gt;

&lt;p&gt;I &lt;a href="https://github.com/Seneca-CDOT/telescope/pull/2903"&gt;wrote a simple test&lt;/a&gt; for the dependency-discovery service which required me to refactor an export of the module to mock one &lt;br&gt;
of the functions so that we wouldn't rely on the &lt;code&gt;deps.txt&lt;/code&gt; file. &lt;/p&gt;

&lt;p&gt;I managed to fix renovate bot issues and my parser service is very close to be merged. Oh, please Tue, remember to remove unnecessary dependencies next time you work on something similar 🙃. &lt;/p&gt;

</description>
    </item>
    <item>
      <title>5th week in</title>
      <dc:creator>Tue</dc:creator>
      <pubDate>Sun, 13 Feb 2022 19:05:07 +0000</pubDate>
      <link>https://dev.to/tuenguyen2911_67/5th-week-in-fjl</link>
      <guid>https://dev.to/tuenguyen2911_67/5th-week-in-fjl</guid>
      <description>&lt;h2&gt;
  
  
  Being more involved:
&lt;/h2&gt;

&lt;p&gt;I've been trying to be more involved in reading up people's work and reviewing PRs. I started out by testing the PR, reading the code and commented any questions I had, as Dave said it's also about spreading knowledge. It was challenging because some PRs can take long to read and understand but I did learn more especially with Duke's PRs regarding Supabase &lt;a href="https://github.com/Seneca-CDOT/telescope/pull/2844"&gt;2844&lt;/a&gt; but couldn't leave any advice. Meanwhile, with less intensive PRs, I learned as I go and I actually helped clear around 7 PRs, wow. &lt;/p&gt;

&lt;h2&gt;
  
  
  Fixing Renovate bot not opening PRs:
&lt;/h2&gt;

&lt;p&gt;I was assigned to fix &lt;a href="https://github.com/Seneca-CDOT/telescope/issues/2852"&gt;Renovate bot not creating PRs&lt;/a&gt;. At first, I didn't know much about this bot, but I'm used to these situations, I just started reading up on it and the log. It took a while, but eventually I found &lt;a href="https://docs.renovatebot.com/configuration-options/#branchconcurrentlimit"&gt;this section&lt;/a&gt; in the Renovate Docs, it says that&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;branchConcurrentLimit&lt;br&gt;
Limit to a maximum of x concurrent branches. 0 means no limit, null (default) inherits value from &lt;code&gt;prConcurrentLimit&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;While the log says &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;DEBUG: Reached branch limit - skipping branch creation(branch="renovate/fontsource-monorepo")&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I suspected that there was a branch created by Renovate, and somehow it didn't get merged. And yes, I deleted that branch, Renovate started working again. However, there's still an &lt;a href="https://github.com/Seneca-CDOT/telescope/issues/2725"&gt;issue&lt;/a&gt; with this bot, I have an idea how to fix it, will attempt it soon.&lt;/p&gt;

&lt;h2&gt;
  
  
  Parser service again 😅:
&lt;/h2&gt;

&lt;p&gt;I've been gradually fixing parser service, it seems like there is some unnecessary code in it because I literally copied from &lt;code&gt;backend&lt;/code&gt;. It seems like &lt;code&gt;backend&lt;/code&gt; does expose a few routes in the &lt;code&gt;web&lt;/code&gt; folder, I need to bring this up to Dave and Josue to understand what is expected from this service (does it expose any routes or does it simply just process feeds?), it affects the tests I'm writing. By the way, I came up with some ideas for e2e tests, I'm gonna finalize my thoughts first before bringing this up to people as well. &lt;/p&gt;

&lt;h2&gt;
  
  
  A list of things I've learnt:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The differences between &lt;code&gt;next()&lt;/code&gt; and &lt;code&gt;done()&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;PostgreSQL: Row level security, seed script, cascade delete&lt;/li&gt;
&lt;li&gt;How JWT is gonna be used in telescope (need to wrap my head around this)&lt;/li&gt;
&lt;li&gt;Dependency-discovery service (how it works)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What's down the road:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Sheriff this week&lt;/li&gt;
&lt;li&gt;Helping Jerry with Dependency-discovery service, he got me interested in this&lt;/li&gt;
&lt;li&gt;Making parser work (it seems like more work than I anticipated)&lt;/li&gt;
&lt;li&gt;Writing tests for parser (in progress)&lt;/li&gt;
&lt;li&gt;Dockerize parser&lt;/li&gt;
&lt;li&gt;Changing parser so that we can work with Supabase&lt;/li&gt;
&lt;li&gt;Twitch integration&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>Final progress on 2.6 release</title>
      <dc:creator>Tue</dc:creator>
      <pubDate>Sun, 06 Feb 2022 02:22:51 +0000</pubDate>
      <link>https://dev.to/tuenguyen2911_67/final-progress-on-26-release-4mpa</link>
      <guid>https://dev.to/tuenguyen2911_67/final-progress-on-26-release-4mpa</guid>
      <description>&lt;h2&gt;
  
  
  Fixing showstopper bug:
&lt;/h2&gt;

&lt;p&gt;A few days ago, I tried to start docker containers to debug this feed 304 &lt;a href="https://github.com/Seneca-CDOT/telescope/issues/2604"&gt;issue&lt;/a&gt;, which we eventually closed because we couldn't reproduce the bug, but there were errors regarding &lt;code&gt;mdx&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;./src/markdown-pages/about.md
Attempted import error: 'mdx' is not exported from '@mdx-js/react' (imported as 'mdx').
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It was working just fine a few hours before, we were all taken by surprise by it. It came from front-end part of the code, since &lt;code&gt;mdx&lt;/code&gt; is a dependency from the front-end. After changing versions of &lt;code&gt;next&lt;/code&gt; and &lt;code&gt;mdx&lt;/code&gt;, nothing seemed to work, we decided to take a look at their &lt;a href="https://github.com/mdx-js/mdx"&gt;GitHub&lt;/a&gt;, turned out they had released a new version also a few hours before. We tried a few options based on the answer from this &lt;a href="https://github.com/mdx-js/mdx/issues/1927"&gt;issue&lt;/a&gt; but only installing &lt;code&gt;mdx-js/react&lt;/code&gt; worked for us. We got together on Teams to discuss and fix this, the fix was small but it was fun &lt;/p&gt;

&lt;h2&gt;
  
  
  Making parser service run locally:
&lt;/h2&gt;

&lt;p&gt;I'm in charge of making parser service run and adding tests. Since, backend has changed a lot for the last few months, making parser service run requires some effort. I need to make this happen in 2.7 or else people are gonna add things to backend and I have to update it 😂. &lt;/p&gt;

&lt;p&gt;I was trying to run parser by using normal &lt;code&gt;node index.js&lt;/code&gt; but encountered 2 errors. Sometimes, Redis complained about connection being in subscriber mode so it couldn't do any CRUD operations&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[ 2022-01-30 18:51:41.815 ] ERROR (20140 on DESKTOP-P67GFS3): Error queuing feeds
    err: {
      "type": "Error",
      "message": "Connection in subscriber mode, only subscriber commands may be used",
      "stack":
          Error: Connection in subscriber mode, only subscriber commands may be used
              at Redis.sendCommand (D:\Repos\telescope\src\api\parser\node_modules\ioredis\built\redis\index.js:633:24)
              at Redis.hgetall (D:\Repos\telescope\src\api\parser\node_modules\ioredis\built\commander.js:122:25)
              at getFeed (D:\Repos\telescope\src\api\parser\src\utils\storage.js:105:26)
              at byId (D:\Repos\telescope\src\api\parser\src\data\feed.js:157:24)
              at Array.map (&amp;lt;anonymous&amp;gt;)
              at Function.all (D:\Repos\telescope\src\api\parser\src\data\feed.js:182:28)
              at processTicksAndRejections (node:internal/process/task_queues:96:5)
              at async Promise.all (index 0)
              at async processAllFeeds (D:\Repos\telescope\src\api\parser\src\index.js:75:25)
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or sometimes, it was just a plain unhandled error. &lt;/p&gt;

&lt;p&gt;With the help of Josue, we found the cause to be in &lt;code&gt;redis.js&lt;/code&gt;, the Redis connection. We were exporting an instance of Redis for &lt;code&gt;queue.js&lt;/code&gt; to use and it didn't like that because &lt;code&gt;client&lt;/code&gt; and &lt;code&gt;subscriber&lt;/code&gt; have the same instance I think.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// queue.js&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Bull&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;bull&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;redis&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./redis&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;logger&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../utils/logger&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;redis&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;subscriber&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;redis&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// redis.js&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Redis&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@senecacdot/satellite&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;redis&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Redis&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Redis&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It worked after the change below&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// redis.js&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Redis&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@senecacdot/satellite&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Redis&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So for 2.6, I've managed to put these PRs &lt;a href="https://github.com/Seneca-CDOT/telescope/pull/2716"&gt;2716&lt;/a&gt; &lt;a href="https://github.com/Seneca-CDOT/telescope/pull/2781"&gt;2781&lt;/a&gt; in. &lt;/p&gt;

&lt;p&gt;Other than those major work I mentioned, I've been mostly talking to people and reading up stuff. I had 2 interviews this week which went really well, it occupied a piece of my mind so my progress has been quite slow.&lt;/p&gt;

</description>
      <category>opensource</category>
    </item>
  </channel>
</rss>
