text:
I18n

Fixes #79

@dr0i please deploy on test.

Deployed to test.

Note to self:

npm test fails because the port from .env is used (which is the same port used for the productive service running there). So change that .env-port temporarily for the sake of test.

npm test did fail with:

✕ Should process a correct hook and create the files for a build  (40030ms)
...
● processWebhooks › Should process a correct hook and create the files for a build
expect(received).toBe(expected) // Object.is equality
Expected: 0
Received: 1
111 |     const dataDirContent = (await fs.readdir('data'))
112 |       .filter(filename  => filename !== '.gitignore')
113 |     expect(dataDirContent.length).toBe(0)

Then I removed all files in test/data and did git checkout --  test/data/ and then npm test did succeed.
I compared the  test/data before and after the removing of the files there - but there was no difference. Weird.

I am not "that fluent" in javascript to say the least, so I cannot review properly.
But let me ask some conceptual question: it's not needed to trigger the gatsby build with npm run build when w have the webhook running, right? Because the latter would trigger the build of the vocabularies and expose these, right? (if that`s true I would note this in the README).

Re "super strange weird test/data": just read the README to do a "rm -rf .cache after changes in data/ which may also be true for /test/data/ and which would explain the weirdness.

Redeployed.
Note that, although the daemon comes up, an error message appeared in the logs:

npm ERR! code ELIFECYCLE
This error vanished when doing echo 65536 | sudo tee -a /proc/sys/fs/inotify/max_user_watches.
It seems similar too https://github.com/skohub-io/skohub-vocabs/issues/104 . Although I am not aware of the effects of this npm ERR I will add the fixes as hints into the README.
Opened https://github.com/skohub-io/skohub-vocabs/issues/112 for this.

Redeployed.
Note that, although the daemon comes up, an error message appeared in the logs:

npm ERR! code ELIFECYCLE

I think this is the same error as in https://github.com/skohub-io/skohub-vocabs/issues/79#issuecomment-738652600

Correction:
although a tail -f logs/skohub-vocabs.log didn't reveal the mentioned npm ERR a cat on the log shows that it's still there, so the "fix" using max_user_watches didn't help. Also  npm cache clean --force; rm -rf node_modules package-lock.json didn't help.
As the daemon (that's the webhookserver) shows up we might ignore this.
But there are other problems showing in the log, which I only experience on test:

UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, stat '/home/lod/git/skohub-vocabs/src/../public/'
at Object.statSync (fs.js:932:3)
at Object.statSync (/home/lod/git/skohub-vocabs/node_modules/graceful-fs/polyfills.js:307:34)

The public directory indeed does not exist, but then it also doesn't exist on production.
It should be created when npm run build is done to Run the static site generator, but that's not done in scripts/start.sh.
I am a bit in the dark here maybe you can brighten this up a bit @literarymachine ?

The current status is that it says the build is triggered but the build page is empty, see https://test.skohub.io/build/?id=93625061-84f5-4182-8f8a-677209bcce4e

I think this is the same error as in #79 (comment)

no, this ERR is showing always up when starting via the start script:

npm ERR! code ELIFECYCLE
npm ERR! errno 143
npm ERR! gatsby-starter-default@0.1.0 listen: node src/webHookServer.js
npm ERR! Exit status 143
npm ERR!·
npm ERR! Failed at the gatsby-starter-default@0.1.0 listen script.

I wil at least note this at the server to not forget to just ignore this.

@dr0i, please redeploy to test once again.

@dr0i, please redeploy to test once again.

Redeployed.

Redeployed.

Looks good now from a functional perspective. Please add code review and deploy to production.

Looks good now from a functional perspective. Please add code review and deploy to production.

I am not "that fluent" in javascript to say the least, so I cannot review properly.

If this is ok, though, I can deploy it anyway.

I am not "that fluent" in javascript to say the least, so I cannot review properly.

If this is ok, though, I can deploy it anyway.

@fsteeg, do you want to take a look? Otherwise I am ok with deploying it directly.

@fsteeg, do you want to take a look? Otherwise I am ok with deploying it directly.

Please deploy, then, @dr0i .

Please deploy, then, @dr0i .

Deployed to production, closed.

Deployed to production, closed.

repo: skohub-io/skohub-vocabs


text:
Update zod to the latest non-vulnerable version

see https://github.com/colinhacks/zod/pull/2824

Yikes, quite a bad vulnerability, thanks a lot for this!

You're welcome but a new version hasn't been published on deno x yet

Hello, yeah, sorry about that, haven't really had time for any personal todo list tasks the last week as I've been sick!
Just released v0.1.5! :)

Sorry about your health. Thanks for the release but it looks like just
updating zod’s version brings up some type issues as seen in the screenshot
below. This makes response hint weird type definitions
On Sun, 15 Oct 2023 at 16:52, Skosh @.***> wrote:

Hello, yeah, sorry about that, haven't really had time for any personal
todo list tasks the last week as I've been sick!
Just released v0.1.5! :)
—
Reply to this email directly, view it on GitHub
https://github.com/skoshx/pentagon/pull/38#issuecomment-1763446106, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/AAM3775U347BJ7FQHHO4CY3X7QIGBANCNFSM6AAAAAA5XSK24I
.
You are receiving this because you authored the thread.Message ID:
@.***>

source: gharchive/pull-request

authors: skoshx waptik

repo: skoshx/pentagon

license: MIT

license_type: permissive

license_source: github-api


text:
TypeScript support for the installation generator

TODO:

[ ] add ts-linting scripts
[ ] add tests
[ ] add docs

Hello @skryukov what is needed to bring this PR to main?

@Shaglock thanks for pinging. I've just released a new version with TypeScript support for the installation generator 🎉

authors: Shaglock skryukov


text:
[perf] Do not destroy lists by repeatedly biting off the head

Biting off the head is convenient way of iterating through a list while deleting its elements. The disadvantage is that it performs more operations that is ultimately necessary. It takes care of repeatedly adjusting the list pointers, even though ultimately the entire list is going away.
When @ssorj showed the per-instruction profiling costs, a lot of it was concentrated on movs. So, let's not mov uselessly.
Instead of
void qd_buffer_list_free_buffers(qd_buffer_list_t *list)
{
    qd_buffer_t *buf = DEQ_HEAD(*list);
    while (buf) {
        DEQ_REMOVE_HEAD(*list);
        qd_buffer_free(buf);
        buf = DEQ_HEAD(*list);
    }
}

Do this
void qd_buffer_list_free_buffers(qd_buffer_list_t *list)
{
    qd_buffer_t *buf = list->head;
    while (buf != NULL) {
        qd_buffer_t *next = buf->next;
        qd_buffer_free(buf);
        buf = next;
    }
    ZERO(list);
}

There can be helper macro to wrap the deletion, that would take the for-each deallocating function.
Looking at the generated code, the difference between the two looks like this
--- <unnamed>
+++ <unnamed>
@@ -3,60 +3,35 @@
   43a650:       41 56                   push   %r14
   43a652:       53                      push   %rbx
   43a653:       50                      push   %rax
-  43a654:       48 8b 17                mov    (%rdi),%rdx
-    qd_buffer_t *buf = ((*list).head);
-    while (buf) {
-  43a657:       48 85 d2                test   %rdx,%rdx
-  43a65a:       74 5a                   je     43a6b6 <qd_buffer_list_free_buffers+0x66>
-  43a65c:       48 89 fb                mov    %rdi,%rbx
-  43a65f:       4c 8d 77 08             lea    0x8(%rdi),%r14
-  43a663:       66 2e 0f 1f 84 00 00    cs nopw 0x0(%rax,%rax,1)
-  43a66a:       00 00 00
-  43a66d:       0f 1f 00                nopl   (%rax)
-        do {
-            {
-                ((void) (0));
-            };
-            if ((*list).head) {
-                (*list).scratch = (*list).head;
-  43a670:       48 89 53 10             mov    %rdx,0x10(%rbx)
-                (*list).head    = (*list).head->next;
-  43a674:       48 8b 42 08             mov    0x8(%rdx),%rax
-  43a678:       48 89 03                mov    %rax,(%rbx)
-                if ((*list).head == 0) {
-  43a67b:       48 85 c0                test   %rax,%rax
-  43a67e:       49 0f 44 c6             cmove  %r14,%rax
-  43a682:       48 c7 00 00 00 00 00    movq   $0x0,(%rax)
-                    {
-                        ((void) (0));
-                    };
-                } else
-                    (*list).head->prev = 0;
-                (*list).size--;
-  43a689:       48 83 43 18 ff          addq   $0xffffffffffffffff,0x18(%rbx)
-                (*list).scratch->next = 0;
-                (*list).scratch->prev = 0;
-  43a68e:       0f 57 c0                xorps  %xmm0,%xmm0
-  43a691:       0f 11 02                movups %xmm0,(%rdx)
+  43a654:       49 89 fe                mov    %rdi,%r14
+    qd_buffer_t *buf = list->head;
+  43a657:       48 8b 17                mov    (%rdi),%rdx
+    while (buf != NULL) {
+  43a65a:       48 85 d2                test   %rdx,%rdx
+  43a65d:       74 27                   je     43a686 <qd_buffer_list_free_buffers+0x36>
+  43a65f:       90                      nop
+        qd_buffer_t *next = buf->next;
+  43a660:       48 8b 5a 08             mov    0x8(%rdx),%rbx
 ALLOC_DEFINE_CONFIG(qd_buffer_t, sizeof(qd_buffer_t), &BUFFER_SIZE, 0);
-  43a694:       64 48 8b 04 25 00 00    mov    %fs:0x0,%rax
-  43a69b:       00 00
-  43a69d:       48 8d b0 f0 f5 ff ff    lea    -0xa10(%rax),%rsi
-  43a6a4:       bf 00 9e 4b 00          mov    $0x4b9e00,%edi
-  43a6a9:       e8 f2 ed ff ff          call   4394a0 <qd_dealloc>
-  43a6ae:       48 8b 13                mov    (%rbx),%rdx
-    while (buf) {
-  43a6b1:       48 85 d2                test   %rdx,%rdx
-  43a6b4:       75 ba                   jne    43a670 <qd_buffer_list_free_buffers+0x20>
-            }
-        } while (0);
+  43a664:       64 48 8b 04 25 00 00    mov    %fs:0x0,%rax
+  43a66b:       00 00
+  43a66d:       48 8d b0 f0 f5 ff ff    lea    -0xa10(%rax),%rsi
+  43a674:       bf 00 9e 4b 00          mov    $0x4b9e00,%edi
+  43a679:       e8 22 ee ff ff          call   4394a0 <qd_dealloc>
+  43a67e:       48 89 da                mov    %rbx,%rdx
+    while (buf != NULL) {
+  43a681:       48 85 db                test   %rbx,%rbx
+  43a684:       75 da                   jne    43a660 <qd_buffer_list_free_buffers+0x10>
         qd_buffer_free(buf);
-        buf = ((*list).head);
+        buf = next;
     }
+    list->size = 0;
+  43a686:       49 c7 46 18 00 00 00    movq   $0x0,0x18(%r14)
+  43a68d:       00
 }
-  43a6b6:       48 83 c4 08             add    $0x8,%rsp
-  43a6ba:       5b                      pop    %rbx
-  43a6bb:       41 5e                   pop    %r14
-  43a6bd:       c3                      ret
+  43a68e:       48 83 c4 08             add    $0x8,%rsp
+  43a692:       5b                      pop    %rbx
+  43a693:       41 5e                   pop    %r14
+  43a695:       c3                      ret

 Disassembly of section .fini:

More radical change of course would be to replace linked list with a contiguous array, for better memory locality while iterating. This however is not a small patch.
Previously, @franz1981 used the idea of replacing linked list in https://github.com/apache/qpid-dispatch/pull/537 and in https://github.com/apache/qpid-dispatch/pull/525.

Less radical change would be to get rid of the scratch field in the struct and create a scratch local variable in the macro. GCC has __typeof__ and __auto_type nonstandard extensions. https://gcc.gnu.org/onlinedocs/gcc/Typeof.html.
That should also help remove some useless work.

Let's start with your first suggestion.  It looks good to me but I'd suggest replacing:

the ZERO(list) at the end with DEQ_INIT(*list)
use DEQ_NEXT(buf) instead of directly accessing the ->next pointer

Just in case at some point we do radically redesign the DEQ stuff the API can hide all that.
Once you've got a PR for that let's run it past @ssorj for his performance analysis.

About this performance analysis. I think that

we need to have a battery of checks; when I tried this, I was only testing on my laptop with AMQP, default quiver settings, one pair of arrows talking to each other through one router. Each measurement repeated 9 times to compute confidence interval (basic formula I googled somewhere, assuming t-distribution, what scipy implements). Imagine what if I, while improving that scenario, possibly 1) made TCP adaptor slower, somehow; 2) made large AMQP message case slower 3) made inter-router AMQP messages transporting TCP, HTTP, HTTP2, the router network protocol, ..., slower 4) made scenarios that don't operate over localhost but instead run over real network slower 5) increased memory consumption 6) increased (or detrimentally shifted the distribution of) latencies 7) broke or worsened something else that is not measured
the checks should be written/orchestrated using https://github.com/Hyperfoil/qDup and should live in this repo, so that they can run in GHA (not for precise measurement, but just in some short-run mode, to check they still work)
they should run against the router containerimage?

My results
base, some commit randomly taken from main, at the time I was running this few days ago, I can find out which commit, but I did not write it down
Estimated message rate is 53938.7 +- 507 msgs/second at 95% confidence

direct buffer del jd_2022_03_26_qd_buffer_list_free_buffers
Estimated message rate is 54356.6 +- 321 msgs/second at 95% confidence

scratch jd_2022_03_30_scratch_list_delete
Estimated message rate is 54273.5 +- 382 msgs/second at 95% confidence

futex jd_2022_03_28_futex
Estimated message rate is 56925.3 +- 258 msgs/second at 95% confidence

futexes + scratch
Estimated message rate is 57131.5 +- 276 msgs/second at 95% confidence

base is already explained above

direct buffer del is just the do this code from above

scratch is the previous, and I also removed the scratch struct field using __typeof__ in the list manipulation macros

futex is mentioned to provide context to the next measurement, it replaces pthread mutexes with my own, implemented according to http://people.redhat.com/drepper/futex.pdf (I tried a two-state mutex, (locked, unlocked), but that was way slower than pthreads, so I did the three-level mutex from the paper, (unlocked, locked-uncontended, locked-contended) and that is significantly faster than pthreads, most likely because these mutexes are very cheap to initialize and free)

futexes + scratch are simply the scratch and futex patches applied together

Conclusion
Size of confidence interval is mostly influence of other processes and os running on laptop. (I only started looking into cpu isolation, etc, afterwards; here I only set fixed CPU frequency.)
The positive effect seems small, almost definitely would not be statistically significant, given the wide confidence intervals, but I believe it is real.
Improving just the qd_buffer_list_free_buffers function seems to give almost all the benefit of the larger patch.
Compared to the improvement from the futexes, they look more promising. I am of course not proposing we write our own mutex using futex and atomics, but that we try to avoid inefficiencies when using the pthread one, especially freeing and creating a mutex per message, as described in https://github.com/skupperproject/skupper-router/issues/252.
Next up, I think it would be good to redo this with LTO, and maybe look for more opportunities to optimize list deletions (in the measured patch I only replaced the simple straightforward cases).
I imagine deciding to optimize only qd_buffer_list_free_buffers now, the way Ken suggested, and not improve other list deletions, except if they start to become problems.
Linked lists must be eradicated, not improved.

As a next step, it would be possible to try to completely eliminate the DEQ_REMOVE_HEAD and DEQ_REMOVE_TAIL usages in loops. Probably best to measure the actual performance impact first.

source: gharchive/issue

authors: jiridanek kgiusti

repo: skupperproject/skupper-router


text:
FileHeader is very slow

It takes too much time to add header info.
OS: macOS Sierra
Memory: 16G
CPU: 2.2 GHz Intel Core i7
Below is the console log.
reloading settings Packages/FileHeader/FileHeader.sublime-settings
reloading plugin FileHeader.FileHeader
Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 168, in reload_plugin
    el.on_activated(v)
  File "/Users/cj/Library/Application Support/Sublime Text 3/Packages/FileHeader/FileHeader.py", line 685, in on_activated
    block(view, self.update_automatically, view, FILE_PATH)
  File "/Users/cj/Library/Application Support/Sublime Text 3/Packages/FileHeader/FileHeader.py", line 339, in block
    _block()
  File "/Users/cj/Library/Application Support/Sublime Text 3/Packages/FileHeader/FileHeader.py", line 337, in _block
    callback(*args, **kwargs)
  File "/Users/cj/Library/Application Support/Sublime Text 3/Packages/FileHeader/FileHeader.py", line 594, in update_automatically
    syntax_type = get_syntax_type(view.file_name())
  File "/Users/cj/Library/Application Support/Sublime Text 3/Packages/FileHeader/FileHeader.py", line 298, in get_syntax_type
    if suffix in extension_equivalence:
TypeError: argument of type 'NoneType' is not iterable

I am sorry to post in the wrong place.

repo: skuroda/Sublime-AdvancedNewFile

license: mit

license_source: bigquery


text:
Changing camera source on a MacBook

I'm trying to use this script, https://github.com/kevinam99/capturing-images-from-webcam-using-opencv-python/blob/master/webcam-capture-v1.01.py, on my MacBook with an extra, USB webcam attached to it to take a quick picture for a demo. But, I'm unable to access the USB cam, only the built-in iSight or whatever camera.
I know the script is from another person, but he hasn't been answering any questions, so I thought I would try here.
I had hoped that changing webcam = cv2.VideoCapture(0) to webcam = cv2.VideoCapture(1) would allow me to use the USB camera, but it still uses the built-in camera. The USB camera does work with Photo Booth and other applications, but not via this py file. Any ideas on what I need to do?
Thanks for any help!

Maybe, It is due to macOS Mojave new privacy protections when an app is requiring access to the webcam or microphone if you are using the same.

repo: skvark/opencv-python


text:
Got Instagram API to return object with data

Hey Michael,
Just wanted to let you know that I finally got it working! It was, in the end, the vm = this; issue. Is there a better way to write this with $scope or is the vm was the best practice?
Thank for all your help!
Skyler

I don't get it, so adding vm = this  causes the problem or is it the solution

It is the solution (seemingly). I also changed my function declaration to vm.instaApi and jsonpCallback: "vm.instaApi",

woah, that was a bold move.  Have you made certain which is the one that solves the problem?

I belive I had to prepend both of the function references with vm. for it to work. I started just with the function declaration but then the .$ajax object didn't recognize instaApi until I added vm. to it.

that is super interesting and sheds light on some part of the mechanics that I clearly do not understand.  Excellent work man!

merged 👍

that is super interesting and sheds light on some part of the mechanics
that I clearly do not understand.  Excellent work man!
Michael Pell
1 (919) 408 7153
Skype: MichaelCPell
On 20 May 2016 at 11:47, Skyler Braden notifications@github.com wrote:

I belive I had to prepend both of the function references with vm. for it
to work. I started just with the function declaration but then the .$ajax
object didn't recognize instaApi until I added vm. to it.
—
You are receiving this because you were assigned.
Reply to this email directly or view it on GitHub
https://github.com/skylerbraden/journeygram/pull/1#issuecomment-220643187

The vm trick I learned from you on a previous AngularJS project!
Thanks for merging. Do I just need to do a git pull now to update my local?

if you need to.  You can also just merge it from local.
But the real innovation here was prefacing the callback function with
vm.  I don't know how long it would have taken me to try that.
Michael Pell
1 (919) 408 7153
Skype: MichaelCPell
On 20 May 2016 at 11:51, Skyler Braden notifications@github.com wrote:

The vm trick I learned from you on a previous AngularJS project!
Thanks for merging. Do I just need to do a git pull now to update my
local?
—
You are receiving this because you modified the open/close state.
Reply to this email directly or view it on GitHub
https://github.com/skylerbraden/journeygram/pull/1#issuecomment-220644202

Ah yes, that makes sense.
We maybe I understand a little more than I think. I feel braindead half the time!

authors: MichaelCPell skylerbraden

repo: skylerbraden/journeygram


text:
Unable to Download Stories

Snapchat Downloader version: 1.4.3
Python version: 2.7.16
Operating System: Mac OS 10.15.7 (Catalina)

Description
I was trying to download stories as usual from my list but the command I normally use no longer seems to work. It was working as of 14 hours ago. Normally, when I type the command, it just starts saving stories from my list. I've tried this a few times and no luck. (Not really good at coding/tech stuff, so I don't really understand the error message... please also let me know if there are missing elements to this report and how I can find these things if needed). Thank you!
What I Did
Paste the command(s) you ran and the output.
If there was a crash, please include the traceback here.

snapchat-dl -u -i Usernames0.bat  -P SnapDownloads
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/snapchat_dl/snapchat_dl.py", line 63, in _web_fetch_story
response_json = json.loads(response_json_raw[0])
IndexError: list index out of range
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.10/bin/snapchat-dl", line 8, in
sys.exit(main())
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/snapchat_dl/app.py", line 58, in main
download_users(usernames)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/snapchat_dl/app.py", line 53, in download_users
downlaoder.download(username)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/snapchat_dl/snapchat_dl.py", line 93, in download
stories, snap_user = self._web_fetch_story(username)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/snapchat_dl/snapchat_dl.py", line 82, in _web_fetch_story
raise APIResponseError
snapchat_dl.utils.APIResponseError

I'm also getting this same error, if anyone has figured out a fix or wants to fork this project to fix this issue reach out to me please.

I used chatgpt to fix it, just replace the snapchat_dl.py with this:
`"""The Main Snapchat Downloader Class."""
import concurrent.futures
import json
import os
import re
import requests
from loguru import logger
from snapchat_dl.downloader import download_url
from snapchat_dl.utils import APIResponseError
from snapchat_dl.utils import dump_response
from snapchat_dl.utils import MEDIA_TYPE
from snapchat_dl.utils import NoStoriesFound
from snapchat_dl.utils import strf_time
from snapchat_dl.utils import UserNotFoundError
class SnapchatDL:
"""Interact with Snapchat API to download story."""
def __init__(
    self,
    directory_prefix=".",
    max_workers=2,
    limit_story=-1,
    sleep_interval=1,
    quiet=False,
    dump_json=False,
):
    self.directory_prefix = os.path.abspath(os.path.normpath(directory_prefix))
    self.max_workers = max_workers
    self.limit_story = limit_story
    self.sleep_interval = sleep_interval
    self.quiet = quiet
    self.dump_json = dump_json
    self.endpoint_web = "https://www.snapchat.com/add/{}/"
    self.regexp_web_json = (
        r'<script\s*id="__NEXT_DATA__"\s*type="application\/json">([^<]+)<\/script>'
    )
    self.response_ok = requests.codes.get("ok")

def _api_response(self, username):
    web_url = self.endpoint_web.format(username)
    headers = {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36"
    }
    response = requests.get(web_url, headers=headers)
    return response.text

def _web_fetch_story(self, username):
    response = self._api_response(username)
    response_json_raw = re.findall(self.regexp_web_json, response)

    if not response_json_raw:
        logger.error(f"No JSON response found for {username}. Response: {response}")
        raise APIResponseError

    try:
        response_json = json.loads(response_json_raw[0])

        def util_web_user_info(content: dict):
            if "userProfile" in content["props"]["pageProps"]:
                user_profile = content["props"]["pageProps"]["userProfile"]
                field_id = user_profile["$case"]
                return user_profile[field_id]
            else:
                raise UserNotFoundError

        def util_web_story(content: dict):
            if "story" in content["props"]["pageProps"]:
                return content["props"]["pageProps"]["story"]["snapList"]
            return list()

        user_info = util_web_user_info(response_json)
        stories = util_web_story(response_json)
        return stories, user_info

    except (IndexError, KeyError, ValueError) as e:
        logger.error(f"Failed to fetch story for {username}. Error: {e}, Response: {response}")
        raise APIResponseError

def download(self, username):
    """Download Snapchat Story for `username`.

    Args:
        username (str): Snapchat `username`

    Returns:
        [bool]: story downloader
    """
    stories, snap_user, *_ = self._web_fetch_story(username)

    if len(stories) == 0:
        if self.quiet is False:
            logger.info("\033[91m{}\033[0m has no stories".format(username))

        raise NoStoriesFound

    if self.limit_story > -1:
        stories = stories[0 : self.limit_story]

    logger.info("[+] {} has {} stories".format(username, len(stories)))

    executor = concurrent.futures.ThreadPoolExecutor(max_workers=self.max_workers)
    try:
        for media in stories:
            snap_id = media["snapId"]["value"]
            media_url = media["snapUrls"]["mediaUrl"]
            media_type = media["snapMediaType"]
            timestamp = int(media["timestampInSec"]["value"])
            date_str = strf_time(timestamp, "%Y-%m-%d")

            dir_name = os.path.join(self.directory_prefix, username, date_str)

            filename = strf_time(timestamp, "%Y-%m-%d_%H-%M-%S {} {}.{}").format(
                snap_id, username, MEDIA_TYPE[media_type]
            )

            if self.dump_json:
                filename_json = os.path.join(dir_name, filename + ".json")
                media_json = dict(media)
                media_json["snapUser"] = snap_user
                dump_response(media_json, filename_json)

            media_output = os.path.join(dir_name, filename)
            executor.submit(
                download_url, media_url, media_output, self.sleep_interval
            )

    except KeyboardInterrupt:
        executor.shutdown(wait=False)

    logger.info("[✔] {} stories downloaded".format(username))

`

Thanks @promers for the suggestion. I copy pasted your code and completely replaced what was in the original snapchat_dl.py and saved it but it still did not work.
Maybe I'm doing something wrong?

Ok, thanks to @promers, I also tried Chatgpt to fix things and this is what mine came up with (and it works). Like @promers suggested, replace snapchat_dl.py with the following:
``
"""The Main Snapchat Downloader Class."""
import concurrent.futures
import json
import os
import re
import requests
from loguru import logger
from snapchat_dl.downloader import download_url
from snapchat_dl.utils import (
APIResponseError,
dump_response,
MEDIA_TYPE,
NoStoriesFound,
strf_time,
UserNotFoundError,
)
class SnapchatDL:
"""Interact with Snapchat API to download story."""
def __init__(
    self,
    directory_prefix=".",
    max_workers=2,
    limit_story=-1,
    sleep_interval=1,
    quiet=False,
    dump_json=False,
):
    self.directory_prefix = os.path.abspath(os.path.normpath(directory_prefix))
    self.max_workers = max_workers
    self.limit_story = limit_story
    self.sleep_interval = sleep_interval
    self.quiet = quiet
    self.dump_json = dump_json
    self.endpoint_web = "https://story.snapchat.com/@{}"
    self.regexp_web_json = (
        r'<script\s*id="__NEXT_DATA__"\s*type="application\/json">([^<]+)<\/script>'
    )

def _api_response(self, username):
    web_url = self.endpoint_web.format(username)
    headers = {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3"
    }
    return requests.get(web_url, headers=headers)

def _web_fetch_story(self, username):
    """Download user stories from Web.

    Args:
        username (str): Snapchat `username`

    Raises:
        APIResponseError: API Error

    Returns:
        (list, dict): stories, user_info
    """
    response = self._api_response(username)

    if response.status_code != requests.codes.ok:
        logger.error(f"Failed to fetch data for {username}. Status code: {response.status_code}. "
                     f"Response: {response.text}")
        raise APIResponseError

    response_json_raw = re.findall(self.regexp_web_json, response.text)

    try:
        response_json = json.loads(response_json_raw[0])

        def util_web_user_info(content: dict):
            if "userProfile" in content["props"]["pageProps"]:
                user_profile = content["props"]["pageProps"]["userProfile"]
                field_id = user_profile["$case"]
                return user_profile[field_id]
            else:
                raise UserNotFoundError

        def util_web_story(content: dict):
            if "story" in content["props"]["pageProps"]:
                return content["props"]["pageProps"]["story"]["snapList"]
            return list()

        user_info = util_web_user_info(response_json)
        stories = util_web_story(response_json)
        return stories, user_info
    except (IndexError, KeyError, ValueError) as e:
        logger.error(f"Error parsing response for {username}: {e}")
        raise APIResponseError

def _download_media(self, media, username, snap_user):
    snap_id = media["snapId"]["value"]
    media_url = media["snapUrls"]["mediaUrl"]
    media_type = media["snapMediaType"]
    timestamp = int(media["timestampInSec"]["value"])
    date_str = strf_time(timestamp, "%Y-%m-%d")

    dir_name = os.path.join(self.directory_prefix, username, date_str)
    os.makedirs(dir_name, exist_ok=True)  # Ensure the directory exists

    filename = strf_time(timestamp, "%Y-%m-%d_%H-%M-%S {} {}.{}").format(
        snap_id, username, MEDIA_TYPE[media_type]
    )

    if self.dump_json:
        filename_json = os.path.join(dir_name, f"{filename}.json")
        media_json = dict(media)
        media_json["snapUser"] = snap_user
        dump_response(media_json, filename_json)

    media_output = os.path.join(dir_name, filename)
    return media_url, media_output

def download(self, username):
    """Download Snapchat Story for `username`.

    Args:
        username (str): Snapchat `username`

    Raises:
        NoStoriesFound: If no stories are found
    """
    stories, snap_user = self._web_fetch_story(username)

    if not stories:
        if not self.quiet:
            logger.info(f"\033[91m{username}\033[0m has no stories.")
        raise NoStoriesFound

    if self.limit_story > -1:
        stories = stories[:self.limit_story]

    logger.info(f"[+] {username} has {len(stories)} stories.")

    executor = concurrent.futures.ThreadPoolExecutor(max_workers=self.max_workers)
    try:
        for media in stories:
            media_url, media_output = self._download_media(media, username, snap_user)
            executor.submit(download_url, media_url, media_output, self.sleep_interval)

    except KeyboardInterrupt:
        executor.shutdown(wait=False)

    logger.info(f"[✔] {len(stories)} stories downloaded for {username}.")

``

Alot of verbose output with 404'd users with those fixes.
Here's a fix for that too.
"""The Main Snapchat Downloader Class."""
import concurrent.futures
import json
import os
import re

import requests
from loguru import logger

from snapchat_dl.downloader import download_url
from snapchat_dl.utils import (
    APIResponseError,
    dump_response,
    MEDIA_TYPE,
    NoStoriesFound,
    strf_time,
    UserNotFoundError,
)

class SnapchatDL:
    """Interact with Snapchat API to download story."""

    def __init__(
        self,
        directory_prefix=".",
        max_workers=2,
        limit_story=-1,
        sleep_interval=1,
        quiet=False,
        dump_json=False,
    ):
        self.directory_prefix = os.path.abspath(os.path.normpath(directory_prefix))
        self.max_workers = max_workers
        self.limit_story = limit_story
        self.sleep_interval = sleep_interval
        self.quiet = quiet
        self.dump_json = dump_json
        self.endpoint_web = "https://story.snapchat.com/@{}"
        self.regexp_web_json = (
            r'<script\s*id="__NEXT_DATA__"\s*type="application\/json">([^<]+)<\/script>'
        )

    def _api_response(self, username):
        web_url = self.endpoint_web.format(username)
        headers = {
            "User-Agent": (
                "Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
                "AppleWebKit/537.36 (KHTML, like Gecko) "
                "Chrome/58.0.3029.110 Safari/537.3"
            )
        }
        return requests.get(web_url, headers=headers)

    def _web_fetch_story(self, username):
        """Download user stories from Web.

        Args:
            username (str): Snapchat `username`

        Raises:
            APIResponseError: API Error

        Returns:
            (list, dict): stories, user_info
        """
        response = self._api_response(username)

        if response.status_code != requests.codes.ok:
            if response.status_code == 404:
                logger.error(f"User '{username}' not found (404).")
            else:
                logger.error(f"Failed to fetch data for '{username}'. Status code: {response.status_code}.")
            raise APIResponseError

        response_json_raw = re.findall(self.regexp_web_json, response.text)

        try:
            response_json = json.loads(response_json_raw[0])

            def util_web_user_info(content: dict):
                if "userProfile" in content["props"]["pageProps"]:
                    user_profile = content["props"]["pageProps"]["userProfile"]
                    field_id = user_profile["$case"]
                    return user_profile[field_id]
                else:
                    raise UserNotFoundError

            def util_web_story(content: dict):
                if "story" in content["props"]["pageProps"]:
                    return content["props"]["pageProps"]["story"]["snapList"]
                return list()

            user_info = util_web_user_info(response_json)
            stories = util_web_story(response_json)
            return stories, user_info
        except (IndexError, KeyError, ValueError) as e:
            logger.error(f"Error parsing response for '{username}': {e}")
            raise APIResponseError

    def _download_media(self, media, username, snap_user):
        snap_id = media["snapId"]["value"]
        media_url = media["snapUrls"]["mediaUrl"]
        media_type = media["snapMediaType"]
        timestamp = int(media["timestampInSec"]["value"])
        date_str = strf_time(timestamp, "%Y-%m-%d")

        dir_name = os.path.join(self.directory_prefix, username, date_str)
        os.makedirs(dir_name, exist_ok=True)  # Ensure the directory exists

        filename = strf_time(timestamp, "%Y-%m-%d_%H-%M-%S {} {}.{}").format(
            snap_id, username, MEDIA_TYPE[media_type]
        )

        if self.dump_json:
            filename_json = os.path.join(dir_name, f"{filename}.json")
            media_json = dict(media)
            media_json["snapUser"] = snap_user
            dump_response(media_json, filename_json)

        media_output = os.path.join(dir_name, filename)
        return media_url, media_output

    def download(self, username):
        """Download Snapchat Story for `username`.

        Args:
            username (str): Snapchat `username`
        """
        try:
            stories, snap_user = self._web_fetch_story(username)
        except APIResponseError:
            logger.error(f"Could not fetch data for '{username}'. The user may not exist or has no public stories.")
            return

        if not stories:
            if not self.quiet:
                logger.info(f"{username} has no stories.")
            return

        logger.info(f"[+] {username} has {len(stories)} stories.")

        executor = concurrent.futures.ThreadPoolExecutor(max_workers=self.max_workers)
        try:
            for media in stories:
                media_url, media_output = self._download_media(media, username, snap_user)
                executor.submit(download_url, media_url, media_output, self.sleep_interval)
        except KeyboardInterrupt:
            executor.shutdown(wait=False)

        logger.info(f"[✔] {len(stories)} stories downloaded for {username}.")

Thanks for the correction. It works better now!
Interestingly, some SnapStar profiles (have golden stars beside their usernames) have stories when viewed on Snap but not when their profile is viewed on the web (i.e. as https://www.snapchat.com/add/username). As such, snapchat-dl is unable to download their stories. Is there any workaround for those?

Thanks @promers for the suggestion. I copy pasted your code and completely replaced what was in the original snapchat_dl.py using a text editor, and then saved it, but it still did not work.
Maybe I'm doing something wrong?
This is what I get when I try:
snapchat-dl foodwithmichel -P SnapDownloads

2024-10-02 20:21:03.367 | ERROR    | snapchat_dl.snapchat_dl:_web_fetch_story:73 - Failed to fetch story for foodwithmichel. Response: <!doctype html><meta charset="utf-8"><meta name=viewport content="width=device-width, initial-scale=1"><title>403</title>403 Forbidden
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/snapchat_dl/snapchat_dl.py", line 46, in _web_fetch_story
    response_json = json.loads(response_json_raw[0])
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.10/bin/snapchat-dl", line 8, in <module>
    sys.exit(main())
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/snapchat_dl/app.py", line 58, in main
    download_users(usernames)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/snapchat_dl/app.py", line 53, in download_users
    downlaoder.download(username)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/snapchat_dl/snapchat_dl.py", line 85, in download
    stories, highlights, snap_user, *_ = self._web_fetch_story(username)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/snapchat_dl/snapchat_dl.py", line 74, in _web_fetch_story
    raise APIResponseError
snapchat_dl.utils.APIResponseError

Oops my bad. Even though it worked on my end, it's seems that chatgpt did not fully update the code when i tried to add highlights. Glad you fixed it.

Alot of verbose output with 404'd users with those fixes.
Here's a fix for that too.
"""The Main Snapchat Downloader Class."""
import concurrent.futures
import json
import os
import re

import requests
from loguru import logger

from snapchat_dl.downloader import download_url
from snapchat_dl.utils import (
    APIResponseError,
    dump_response,
    MEDIA_TYPE,
    NoStoriesFound,
    strf_time,
    UserNotFoundError,
)

class SnapchatDL:
    """Interact with Snapchat API to download story."""

    def __init__(
        self,
        directory_prefix=".",
        max_workers=2,
        limit_story=-1,
        sleep_interval=1,
        quiet=False,
        dump_json=False,
    ):
        self.directory_prefix = os.path.abspath(os.path.normpath(directory_prefix))
        self.max_workers = max_workers
        self.limit_story = limit_story
        self.sleep_interval = sleep_interval
        self.quiet = quiet
        self.dump_json = dump_json
        self.endpoint_web = "https://story.snapchat.com/@{}"
        self.regexp_web_json = (
            r'<script\s*id="__NEXT_DATA__"\s*type="application\/json">([^<]+)<\/script>'
        )

    def _api_response(self, username):
        web_url = self.endpoint_web.format(username)
        headers = {
            "User-Agent": (
                "Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
                "AppleWebKit/537.36 (KHTML, like Gecko) "
                "Chrome/58.0.3029.110 Safari/537.3"
            )
        }
        return requests.get(web_url, headers=headers)

    def _web_fetch_story(self, username):
        """Download user stories from Web.

        Args:
            username (str): Snapchat `username`

        Raises:
            APIResponseError: API Error

        Returns:
            (list, dict): stories, user_info
        """
        response = self._api_response(username)

        if response.status_code != requests.codes.ok:
            if response.status_code == 404:
                logger.error(f"User '{username}' not found (404).")
            else:
                logger.error(f"Failed to fetch data for '{username}'. Status code: {response.status_code}.")
            raise APIResponseError

        response_json_raw = re.findall(self.regexp_web_json, response.text)

        try:
            response_json = json.loads(response_json_raw[0])

            def util_web_user_info(content: dict):
                if "userProfile" in content["props"]["pageProps"]:
                    user_profile = content["props"]["pageProps"]["userProfile"]
                    field_id = user_profile["$case"]
                    return user_profile[field_id]
                else:
                    raise UserNotFoundError

            def util_web_story(content: dict):
                if "story" in content["props"]["pageProps"]:
                    return content["props"]["pageProps"]["story"]["snapList"]
                return list()

            user_info = util_web_user_info(response_json)
            stories = util_web_story(response_json)
            return stories, user_info
        except (IndexError, KeyError, ValueError) as e:
            logger.error(f"Error parsing response for '{username}': {e}")
            raise APIResponseError

    def _download_media(self, media, username, snap_user):
        snap_id = media["snapId"]["value"]
        media_url = media["snapUrls"]["mediaUrl"]
        media_type = media["snapMediaType"]
        timestamp = int(media["timestampInSec"]["value"])
        date_str = strf_time(timestamp, "%Y-%m-%d")

        dir_name = os.path.join(self.directory_prefix, username, date_str)
        os.makedirs(dir_name, exist_ok=True)  # Ensure the directory exists

        filename = strf_time(timestamp, "%Y-%m-%d_%H-%M-%S {} {}.{}").format(
            snap_id, username, MEDIA_TYPE[media_type]
        )

        if self.dump_json:
            filename_json = os.path.join(dir_name, f"{filename}.json")
            media_json = dict(media)
            media_json["snapUser"] = snap_user
            dump_response(media_json, filename_json)

        media_output = os.path.join(dir_name, filename)
        return media_url, media_output

    def download(self, username):
        """Download Snapchat Story for `username`.

        Args:
            username (str): Snapchat `username`
        """
        try:
            stories, snap_user = self._web_fetch_story(username)
        except APIResponseError:
            logger.error(f"Could not fetch data for '{username}'. The user may not exist or has no public stories.")
            return

        if not stories:
            if not self.quiet:
                logger.info(f"{username} has no stories.")
            return

        logger.info(f"[+] {username} has {len(stories)} stories.")

        executor = concurrent.futures.ThreadPoolExecutor(max_workers=self.max_workers)
        try:
            for media in stories:
                media_url, media_output = self._download_media(media, username, snap_user)
                executor.submit(download_url, media_url, media_output, self.sleep_interval)
        except KeyboardInterrupt:
            executor.shutdown(wait=False)

        logger.info(f"[✔] {len(stories)} stories downloaded for {username}.")

Thanks for this. I was also having the same issue and this resolved it.

Alot of verbose output with 404'd users with those fixes.
Here's a fix for that too.
"""The Main Snapchat Downloader Class."""
import concurrent.futures
import json
import os
import re

import requests
from loguru import logger

from snapchat_dl.downloader import download_url
from snapchat_dl.utils import (
    APIResponseError,
    dump_response,
    MEDIA_TYPE,
    NoStoriesFound,
    strf_time,
    UserNotFoundError,
)

class SnapchatDL:
    """Interact with Snapchat API to download story."""

    def __init__(
        self,
        directory_prefix=".",
        max_workers=2,
        limit_story=-1,
        sleep_interval=1,
        quiet=False,
        dump_json=False,
    ):
        self.directory_prefix = os.path.abspath(os.path.normpath(directory_prefix))
        self.max_workers = max_workers
        self.limit_story = limit_story
        self.sleep_interval = sleep_interval
        self.quiet = quiet
        self.dump_json = dump_json
        self.endpoint_web = "https://story.snapchat.com/@{}"
        self.regexp_web_json = (
            r'<script\s*id="__NEXT_DATA__"\s*type="application\/json">([^<]+)<\/script>'
        )

    def _api_response(self, username):
        web_url = self.endpoint_web.format(username)
        headers = {
            "User-Agent": (
                "Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
                "AppleWebKit/537.36 (KHTML, like Gecko) "
                "Chrome/58.0.3029.110 Safari/537.3"
            )
        }
        return requests.get(web_url, headers=headers)

    def _web_fetch_story(self, username):
        """Download user stories from Web.

        Args:
            username (str): Snapchat `username`

        Raises:
            APIResponseError: API Error

        Returns:
            (list, dict): stories, user_info
        """
        response = self._api_response(username)

        if response.status_code != requests.codes.ok:
            if response.status_code == 404:
                logger.error(f"User '{username}' not found (404).")
            else:
                logger.error(f"Failed to fetch data for '{username}'. Status code: {response.status_code}.")
            raise APIResponseError

        response_json_raw = re.findall(self.regexp_web_json, response.text)

        try:
            response_json = json.loads(response_json_raw[0])

            def util_web_user_info(content: dict):
                if "userProfile" in content["props"]["pageProps"]:
                    user_profile = content["props"]["pageProps"]["userProfile"]
                    field_id = user_profile["$case"]
                    return user_profile[field_id]
                else:
                    raise UserNotFoundError

            def util_web_story(content: dict):
                if "story" in content["props"]["pageProps"]:
                    return content["props"]["pageProps"]["story"]["snapList"]
                return list()

            user_info = util_web_user_info(response_json)
            stories = util_web_story(response_json)
            return stories, user_info
        except (IndexError, KeyError, ValueError) as e:
            logger.error(f"Error parsing response for '{username}': {e}")
            raise APIResponseError

    def _download_media(self, media, username, snap_user):
        snap_id = media["snapId"]["value"]
        media_url = media["snapUrls"]["mediaUrl"]
        media_type = media["snapMediaType"]
        timestamp = int(media["timestampInSec"]["value"])
        date_str = strf_time(timestamp, "%Y-%m-%d")

        dir_name = os.path.join(self.directory_prefix, username, date_str)
        os.makedirs(dir_name, exist_ok=True)  # Ensure the directory exists

        filename = strf_time(timestamp, "%Y-%m-%d_%H-%M-%S {} {}.{}").format(
            snap_id, username, MEDIA_TYPE[media_type]
        )

        if self.dump_json:
            filename_json = os.path.join(dir_name, f"{filename}.json")
            media_json = dict(media)
            media_json["snapUser"] = snap_user
            dump_response(media_json, filename_json)

        media_output = os.path.join(dir_name, filename)
        return media_url, media_output

    def download(self, username):
        """Download Snapchat Story for `username`.

        Args:
            username (str): Snapchat `username`
        """
        try:
            stories, snap_user = self._web_fetch_story(username)
        except APIResponseError:
            logger.error(f"Could not fetch data for '{username}'. The user may not exist or has no public stories.")
            return

        if not stories:
            if not self.quiet:
                logger.info(f"{username} has no stories.")
            return

        logger.info(f"[+] {username} has {len(stories)} stories.")

        executor = concurrent.futures.ThreadPoolExecutor(max_workers=self.max_workers)
        try:
            for media in stories:
                media_url, media_output = self._download_media(media, username, snap_user)
                executor.submit(download_url, media_url, media_output, self.sleep_interval)
        except KeyboardInterrupt:
            executor.shutdown(wait=False)

        logger.info(f"[✔] {len(stories)} stories downloaded for {username}.")

ok so i downloaded the source code and then i edited the snapchat_dl.py file and copy pasted this code. how do i actually run the program now? (which directory do i have to cmd into and what command do i use?)

You dont need to download the source code manually.
Install it via pip like normal, then locate your copy of snapchat_dl.py that pip gave you.
Something like this:
"C:\Users\USERNAME\AppData\Local\Programs\Python\Python311\Lib\site-packages\snapchat_dl\snapchat_dl.py"
Basically the editable file will be in your site-packages/snapchat_dl directory.

Seems like Snapchat changed again, can't view posts anymore with their original username. Im not sure but it seems they changed the username to a random string like this (https://www.snapchat.com/p/7f66910b-1cee-4824-8562-8b00ac90217a) I could be wrong.

Thanks for this guys, can someone let me know if you can download stories like these? https://www.snapchat.com/p/6f098158-691e-46b4-a82d-6a98b3f15dc8/3298905170300928
When I input the username it says it has no stories so I am not exactly sure what is going on.


text:
Update Bugen's work

I've updated my work on CS158 and CS356.

LGTM. Thanks for contribution!

authors: BugenZhao skyzh

repo: skyzh/awesome-cs


text:
How to add custom inline blot (or any blot whatsoever)?

I'm getting out of ideas. After trying for an eternity I'd like to ask directly how it's possible to add a blot in Angular.
I want the user to be able to annotate text. Ideally it would be possible to add overlapping annotation but I'd be happy if adding a simple blot would work for a start.
I'm essentially creating an Annotation:
import {InlineBlot} from "parchment";
import * as QuillNamespace from 'quill';
let Quill: any = QuillNamespace;

class Annotation extends InlineBlot {
  blotName = "annotation";
  tagName = "SPAN";
  className = "annotation-class";
  static create(node: Node){
    console.log("CREATE");
    return node;
  }
  static formats() {
    return true as any;
  }
}

Quill.register(Annotation, true);

which I try to add like this:
this.quill.on('selection-change', function(range: RangeStatic) {
  if (range) {
    if (range.length > 0) {
      quill.formatText(range, Annotation.tagName, true);
    }
  }
});

However, nothing really happens. There's nothing crashing but there's nothing added as well.
What am I missing here?

Absolutely late to the party, but since your blot is using both a tag and class name, I believe you need to use both somehow.
I had some experience with embeds, and for those there is a special method.
Did you manage to solve this somehow? If not, I could try to take a look :)

https://quilljs.com/guides/cloning-medium-with-parchment/
I'm theory you should use blot name, not tag name I think?

hey @falk-stefan.. had the same issue and after nearly a day fiddling around I found this issue here.. https://github.com/slab/quill/issues/4224
we should not import from "parchment" for some reason, we should do:
import InlineBlot from 'quill/blots/inline';
instead.

authors: falk-stefan ramarivera slaesh

repo: slab/parchment


text:
Port is no longer passed into start

Summary
This PR fixes an issue with how the app is started where it no longer takes the port number. The port number is instead passed to the constructor
Requirements (place an x in each [ ])

[x] I've read and understood the Contributing Guidelines and have done my best effort to follow them.
[x] I've read and agree to the Code of Conduct.

 Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.You have signed the CLA already but the status is still pending? Let us recheck it.

@seratch mentioned this will be fixed with https://github.com/slackapi/bolt-js/issues/1256 - Closing PR

authors: CLAassistant slackmon

repo: slackapi/bolt-js-getting-started-app


text:
Latest SDK cannot programmatically create event callbacks

Hello,
I am one of the maintainers of the open source slackbot Slackminion.
One of the main features of slackminion is the ability to use plugins to run commands (arbitrary Python code).  Due to an internal feature request, I am in the process of extending Slackminion to support routing of arbitrary slack events to plugins (currently, the only way to run plugin code is by using the 'message' type with a command.)
The bot currently registers its callbacks for several event types (message, channel_joined, error) by calling (v1) RTMClient.on directly.  In order to extend this functionality to allow plugins to act upon arbitrary event types, I added functionality to programmatically add event handlers when the plugin is registered.  The code looks something like this:
(...)
                for event_type in plugin.notify_event_types:
                    self.log.info(f'Registering handler for {event_type} for plugin {plugin.__class__.__name__}')
                    try:
                        slack.RTMClient.on(event=event_type, callback=self._event_plugin)
(...)

    # generic handler for handling event types registered by plugins via notify_event_types class attribute
    async def _event_plugin(self, **payload):
        event_type, data = self._unpack_payload(**payload)
        self.plugin_manager.broadcast_event(event_type, data)

Unfortunately when I went to actually run this code, I got the following exception:
    event_type = data['type']
KeyError: 'type'

After some investigation, I found that the key 'type' is not present in the payload for most event types, due to the 'pop' at  https://github.com/slackapi/python-slack-sdk/blob/main/slack_sdk/rtm/init.py#L431
I looked into moving to the RTM client v2, (which does not strip the type), however in v2 there does not appear to be a way to programmatically generate these handlers, as the only apparent way to add a handler is to use rtm_v2.RTMClient.on as a decorator.
I was able to work around this issue with the v1 RTMClient by monkey-patching the _dispatch_event method in RTMClient like so:
class MyRTMClient(RTMClient):

    async def _dispatch_event(self, event, data=None):
        data['type'] = event
        return await super()._dispatch_event(event, data)

However, since the v1 code is likely to be deprecated at some point, it would be nice to have similar functionality in the v2 RTMclient to support our use case of programmatically assigning callback functions to events.
If you need any more info, please let me know.
Thanks!
Category (place an x in each of the [ ])

[ ] slack_sdk.web.WebClient (sync/async) (Web API client)
[ ] slack_sdk.webhook.WebhookClient (sync/async) (Incoming Webhook, response_url sender)
[ ] slack_sdk.models (UI component builders)
[ ] slack_sdk.oauth (OAuth Flow Utilities)
[ ] slack_sdk.socket_mode (Socket Mode client)
[ ] slack_sdk.audit_logs (Audit Logs API client)
[ ] slack_sdk.scim (SCIM API client)
[x] slack_sdk.rtm (RTM client)
[ ] slack_sdk.signature (Request Signature Verifier)

Requirements
Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.

Hey @amckenna-pinterest 👋🏻 Thanks for the detailed issue! I'm also happy to see that you're not entirely blocked thanks to your monkey patch.
I've thrown the discussion label on this issue for now, while we decide what direction to take.
@seratch What are your thoughts on next steps?

Hi @amckenna-pinterest, thanks for taking the time to share this with details! If I understand correctly, the v2 RTMClient can already work for your plugin systems (by the way, I like the name "Slackminion" 😄).

as the only apparent way to add a handler is to use rtm_v2.RTMClient.on as a decorator.

This is not clearly mentioned in the document (sorry about that) but it's also possible to use it as a method. My suggestion is to do like this:
import logging
from typing import List, Callable

logging.basicConfig(
    level=logging.DEBUG,
    format="%(asctime)s.%(msecs)03d %(levelname)s %(filename)s (%(lineno)s): %(message)s",
    datefmt="%Y-%m-%d %H:%M:%S",
)  # just for easier debugging
logger = logging.getLogger(__name__)

import os
from slack_sdk.rtm.v2 import RTMClient
from integration_tests.env_variable_names import SLACK_SDK_TEST_CLASSIC_APP_BOT_TOKEN

rtm = RTMClient(
    token=os.environ.get("SLACK_BOT_TOKEN"),
    trace_enabled=True,  # just for easier debugging
    all_message_trace_enabled=True,  # just for easier debugging
)

class Plugin:
    def __init__(
        self,
        notify_event_types: List[str],
        handler: Callable[[RTMClient, dict], None],
    ):
        self.notify_event_types = notify_event_types
        self.handler = handler

def handler1(client: RTMClient, event: dict):
    logger.info("1")

def handler2(client: RTMClient, event: dict):
    logger.info("2")

# This is just for demonstrating how it works with simple examples.
# You can go with a more sophisticated way!
plugin1 = Plugin(notify_event_types=["message"], handler=handler1)
plugin2 = Plugin(notify_event_types=["message", "reaction_added"], handler=handler2)

for event in plugin1.notify_event_types:
    rtm.on(event)(plugin1.handler)

for event in plugin2.notify_event_types:
    rtm.on(event)(plugin2.handler)

rtm.start()

Alternatively, the v2 client has wildcard matching for events. If you prefer the simplicity, this one also works for you.
@rtm.on("*")
def handle(client: RTMClient, event: dict):
    logger.info(event)

I hope this was helpful to you. If I am missing something, helping us understand what you want to achieve would be appreciated!

@amckenna-pinterest The only reason is that we went with the same design with Bolt for Python. Calling the Callable returned from the on method can be a bit surprising to some but we won't change this anymore. As you can see, the v2 implementation is quite simple and we won't apply any changes. If you want to change the part, please feel free to have your own one based on the v2 client.
If there is nothing else to discuss here, would you mind closing this?

Sure, no problem I will close this. Thanks for the prompt replies!

authors: amckenna-pinterest mwbrooks seratch

repo: slackapi/python-slack-sdk


text:
Coloured Bar for Block kit

Description
I can use coloured side bar in attachments but I don't find that option in block kit. I would like to add coloured bar in the below block kit. As of now we are getting only white coloured bar. Is there any way that we can add customized colour bar for the block kit ?
{
	"blocks": [
		{
			"type": "rich_text",
			"elements": [
				{
					"type": "rich_text_quote",
					"elements": [
						{
							"type": "text",
							"text": "I am a basic rich text quote, \n\nI can have multiple paragraph breaks within the block."
						}
					]
				}
			]
		}
	]
}

What type of issue is this? (place an x in one of the [ ])

[ ] bug
[x ] enhancement (feature request)
[ ] question
[ ] documentation related
[ ] example code related
[ ] testing related
[ ] discussion

Requirements (place an x in each of the [ ])

[ x] I've read and understood the Contributing guidelines and have done my best effort to follow them.
[ x] I've read and agree to the Code of Conduct.
[x ] I've searched for any related issues and avoided creating a duplicate issue.

Expected result:

Actual result:

Attachments:
Logs, screenshots, screencast, sample project, funny gif, etc.

Hi @ms3sm2, thanks for asking the question!
When you pass an attachment that includes blocks inside, you can display color bar within a posted message.
{
  "attachments": [
    {
      "color": "#f2c744",
      "blocks": [
        {
          "type": "section",
          "text": {
            "type": "plain_text",
            "text": "This is a plain text section block."
          }
        }
      ]
    }
  ]
}

You can use chat.postMessage to use attachments: https://github.com/slackapi/slack-github-action?tab=readme-ov-file#technique-2-slack-api-method

Hi @seratch ,
I understand that Slack API attachments are deemed legacy and will be phased out shortly. Is this correct?

Attachments are indded no longer recommended for general rich message construction. That said, they won't be removed anytime soon since they are widely used by many apps worldwide. They may be phased out in the long run (say, in years), but there is no timeline for that as of today. Regarding this color bar use case, using blocks as an attachment is the only way to achieve this, so you can rely on it for now.

repo: slackapi/slack-github-action


text:
Target Java 1.8 for Circuit shipped libraries (from Java 11)

Our problem is we want to use Circuit in a SDK potentially used by AGP 4.0 / Java 8 consumers (Unity). Since Circuit target Java 11 we can't build the consumer app. Since current androidx libraries are built for Java 8 it makes sense to downgrade from Java 11 to Java 8 (until androidx team decide to bump to Java 11).
In this change only shipped libraries are impacted. Shipped library mean a POM_ARTIFACT_ID property exists.
The change was tested successfully using a Unity 2020 project with the Circuit counter sample added to our SDK.

Thanks!

authors: ZacSweers eboudrant

repo: slackhq/circuit


text:
EOL announcement

After testing of open-next and SST I will be deprecating this package in foreseeable future in favour of SST and Open-Next.
Reasons are as following:

open-next took basic idea I had with this package and build complete support for developing Next,
connection with SST gives developers amazing experience when running and trying things locally - something I'm not planning to include or try to duplicate,
SST supports newer syntaxes and generally better keeps up with Next's changes thank to bigger community,
open-next builds on CDK and allows deployments to non-Edge lambdas, which go hand-in-hand with ideology of mine and this project,
Extra features such as ISR are supported.

Currently only one concern in mind:

Complexity of open-next and possibility to lot of things to brake (mapping of experimental flags, need to pass Next's env flags to build, Sharp bundling and generally using JS for image optimization - Python implementation we use now). However, with vivid community this is something, we can overcome.

One future issue I came by with current package as well as open-next

bundling of node_modules for Lambda's environment. Binary-specific dependencies get's bundled locally on host OS and might not be compatible with Lambda's runtime. This is industry-wide problem solvable by Docker and pipelines, however, not compatible with SST's dev experience.

Cheers!
Jan

Sad to here that, but the reasons make sence. We currently use your library to build Next.js projects but Open-Next looks promising and evene migration couldn't be so hard.
It's unfortunate to hear about EOL, but the reasons make sense. Currently, we are using your library to build Next.js projects and deploy them to AWS with our custom Terraform configs. However, Open-Next looks promising, and I believe that migrating to it may not be too challenging.

To address complexity concern, I was able to create lambda-only implementation of NextJS deployment to AWS. See: https://github.com/sladg/lambda-server-adapter/blob/master/examples/Next.md.
I will probably publish terraform module later on to deal with optional plugins such as Cloudfront, certificates, faster image optimiser, etc.

authors: davulrich sladg

repo: sladg/nextjs-lambda


text:
架构师成长手册

https://www.sunliaodong.cn/#/
A delightfully simple theme system for docsify.js. Features multiple themes with rich customization options, an improved desktop and mobile experience, and legacy browser support (IE10+).

顶


text:
Add Inspecode tool

Tailor tool:
https://inspecode.rocro.com/help/tools/tailor.html

I am closing this for now. If the author of this project feels its good to merge, please reopen this PR and merge it.

repo: sleekbyte/tailor


text:
Presenter: Unable to switch to the next slide. This issue may be caused by caching.

Describe the bug
When using presenter mode, I utilize the right arrow on my keyboard to navigate to the next page. Initially, the URL reads "http://localhost:3030/presenter/1". Once I press the right arrow, the URL changes to "http://localhost:3030/2". However, the current area still displays page 1, while the next area displays page 3. If I continuously press the right arrow, the URL eventually reads "http://localhost:3030/x", with the current area still showing page 1 and the next area displaying page x+1.
On the other hand, using the button in the lower left corner to switch to the next page works without any issues. Additionally, clearing the browser cache helps resolve the problem.
I vaguely recall encountering an error on the page due to a coding mistake. After making the necessary modifications and restarting vite, the problem with the presenter mode occurred. I am uncertain if the two incidents are related.
To Reproduce
This problem occurred randomly and has not recurred since. Sorry :(
Desktop (please complete the following information):

OS: macOS 13.2.1 (22D68)
Browser: 114.0.5735.198
Slidev version: 0.42.5

Same issue here, but using incognito seems to solve the problem

Same issue here, but using incognito seems to solve the problem

Yes, this is the same principle as I mentioned about clearing the browser cache

A guess, this problem may be caused by the hot start of vite

It should be fixed in the latest version

authors: Camiloruiiz antfu jinsuichen

repo: slidevjs/slidev


text:
slidev export    TimeoutError   rendering...page.goto: Timeout 30000ms exceeded.

$ slidev export
●■▲
Slidev  v0.40.3
theme   @slidev/theme-seriph
entry   /Users/seachal/Documents/SeachalGit/slidev/slidev/slides.md
● rendering...page.goto: Timeout 30000ms exceeded.
=========================== logs ===========================
navigating to "http://localhost:12445/print?print", waiting until "networkidle"
at go (/Users/seachal/Documents/SeachalGit/Working-Stage/Xkw/Share/Markdown)
at genPagePdfOnePiece (/Users/seachal/Documents/SeachalGit/Working-Stage/Xk)
at genPagePdf (/Users/seachal/Documents/SeachalGit/Working-Stage/Xkw/Share/)
at exportSlides (/Users/seachal/Documents/SeachalGit/Working-Stage/Xkw/Shar)
at async Object.handler (/Users/seachal/Documents/SeachalGit/Working-Stage/{

name: 'TimeoutError'
}

You can increase the timeout this way in your frontmatter:
  export:
    format: pdf
    timeout: 60000

authors: Seachal davised


text:
Test:q15_div()

Need test for validation and accuracy.  Note that the accuracy will probably change somewhat between platforms, so the environment needs to be specified.

Tested and working as expected.


text:
Visual editor is not supported for this configuration

Is there an existing issue for this?

[X] I have searched the existing issues

Current Behavior

Visual editor is not supported for this configuration:
s.entries is not a function. (In 's.entries()', 's.entries' is undefined)
You can still edit your config in YAML.
Steps To Reproduce
Add new Card on dashboard
No changes
Cant edit in visual editor because of error
Expected behaviour
Able to edit the config settings in the visual editor.
Card Version
4.4.3
Home Assistant Version
Core : 2023.12.1
Configuration
No response
Relevant log output
No response

Hi. Can you share your card config? Does this happen only when you add a new card or with existing cards as well?

Its the default card. Nothing changed...
type: custom:sunsynk-power-flow-card
cardstyle: full
show_solar: true
battery:
energy: 0
shutdown_soc: 20
show_daily: true
solar:
show_daily: true
mppts: 2
load:
show_daily: true
grid:
show_daily_buy: true
show_daily_sell: false
show_nonessential: true
entities:
use_timer_248: switch.sunsynk_toggle_system_timer
priority_load_243: switch.sunsynk_toggle_priority_load
inverter_voltage_154: sensor.sunsynk_inverter_voltage
load_frequency_192: sensor.sunsynk_load_frequency
inverter_current_164: sensor.sunsynk_inverter_current
inverter_power_175: sensor.sunsynk_inverter_power
grid_connected_status_194: binary_sensor.sunsynk_grid_connected_status
inverter_status_59: sensor.sunsynk_overall_state
day_battery_charge_70: sensor.sunsynk_day_battery_charge
day_battery_discharge_71: sensor.sunsynk_day_battery_discharge
battery_voltage_183: sensor.sunsynk_battery_voltage
battery_soc_184: sensor.sunsynk_battery_soc
battery_power_190: sensor.sunsynk_battery_power
battery_current_191: sensor.sunsynk_battery_current
grid_power_169: sensor.sunsynk_grid_power
day_grid_import_76: sensor.sunsynk_day_grid_import
day_grid_export_77: sensor.sunsynk_day_grid_export
grid_ct_power_172: sensor.sunsynk_grid_ct_power
day_load_energy_84: sensor.sunsynk_day_load_energy
essential_power: none
nonessential_power: none
aux_power_166: sensor.sunsynk_aux_power
day_pv_energy_108: sensor.sunsynk_day_pv_energy
pv1_power_186: sensor.sunsynk_pv1_power
pv2_power_187: sensor.sunsynk_pv2_power
pv1_voltage_109: sensor.sunsynk_pv1_voltage
pv1_current_110: sensor.sunsynk_pv1_current
pv2_voltage_111: sensor.sunsynk_pv2_voltage
pv2_current_112: sensor.sunsynk_pv2_current

It works no issues in yaml editing, but i guess the reason why you wanted to introduce the visual editor was for ease of use.
I have a sunsynk inverter with Solar Assistant integration and use the SA values where applicable.

What browser are you using?

I have tried,
Safari, Chrome, Brave.
Im on MAC , tried on IOS Safari aswell.

It works no issues in yaml editing, but i guess the reason why you wanted to introduce the visual editor was for ease of use. I have a sunsynk inverter with Solar Assistant integration and use the SA values where applicable. So it happens with a new card as well as old changed cards. Updated to latest version 4.5.1 , same problem.

Does it work for you in incognito mode?

Same error.

You should only have one instance (location). Did you ever manually install the card? Can you try delete all instances of the card and install via HACS

Ok

Removed Sunsynk-Power-Flow-Card in hacs.
checked all locations for Sunsynk-Power-Flow-Card , and removed in www.
checked dashboard resources , removed it there.
removed all cards for - Sunsynk-Power-Flow-Card
restart HA
Cleared cache
installed Sunsynk-Power-Flow-Card in HACS
checked in www/community for Sunsynk-Power-Flow-Card (Y)
added plan card : Sunsynk-Power-Flow-Card
same issue. :(

No the HA is on Intel nuc. Haos.Best RegardsRiaan GroblerOn 13 Dec 2023, at 17:48, slipx06 @.***> wrote:
Are both of you using MacBook's?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

I have been completely unable to reproduce this my side. s.entries cannot be found in the compiled js file as well, so I am wondering if this is not perhaps a very niche error for the specific hardware configuration.
Do you perhaps have more logs that could assist in the debug process? Either in the System -> Logs, as well as in developers tools (F12 for chromium based browsers)

I have tested this with a windows PC on Chrome.
Gives the same result.  So the assumption is then safe to say that it is not browser related , but on the HA server.?
When searching for s.entries I cannot find anything in the logs on HA.

Can you share some Chrome console logs.
F12 to open developer console
Access the visual editor and share the output.

Just wanted to add that I have the exact same issue.
I am on Linux using Firefox 121.
I just updated to the latest version of the card and cleared the cache (I think).
Problem is still here. Here is some logs when I try to add the card
Uncaught (in promise) TypeError: o.some is not a function
    updated card-mod.js:5
    promise callback*t.prototype.updated card-mod.js:5
    _$AE reactive-element.ts:1378
    performUpdate reactive-element.ts:1343
    scheduleUpdate reactive-element.ts:1261
    _$Ej reactive-element.ts:1233
    requestUpdate reactive-element.ts:1208
    set reactive-element.ts:726
    value hui-dialog-edit-card.ts:84
    c make-dialog-manager.ts:130
    h make-dialog-manager.ts:163
    r fire_event.ts:76
    o show-edit-card-dialog.ts:18
    value hui-dialog-create-card.ts:213
    handleEvent lit-html.ts:2018
    r fire_event.ts:76
    value hui-card-picker.ts:278
    handleEvent lit-html.ts:2018
    _$AI lit-html.ts:2007
    v lit-html.ts:1192
    g lit-html.ts:1553
    _$AI lit-html.ts:1384
    setValue async-directive.ts:366
    update until.ts:90
    promise callback*update until.ts:72
    _$AS directive.ts:134
    O lit-html.ts:1085
    _$AI lit-html.ts:1362
    v lit-html.ts:1192
    g lit-html.ts:1553
    _$AI lit-html.ts:1384
    T lit-html.ts:1618
    _$AI lit-html.ts:1403
    v lit-html.ts:1192
    g lit-html.ts:1553
    _$AI lit-html.ts:1384
    Z lit-html.ts:2183
    update lit-element.ts:165
    performUpdate reactive-element.ts:1329
    scheduleUpdate reactive-element.ts:1261
    _$Ej reactive-element.ts:1233
    requestUpdate reactive-element.ts:1208
    set reactive-element.ts:726
    value hui-card-picker.ts:234
    value hui-card-picker.ts:210
    _$AE reactive-element.ts:1376
    performUpdate reactive-element.ts:1343
    scheduleUpdate reactive-element.ts:1261
    _$Ej reactive-element.ts:1233
    requestUpdate reactive-element.ts:1208
    _$Eu reactive-element.ts:946
    _ reactive-element.ts:931
[card-mod.js:5:7507](https://haproxmox.ppmt.org/hacsfiles/lovelace-card-mod/card-mod.js?hacstag=190927524315)
Uncaught (in promise) TypeError: o.some is not a function
    updated card-mod.js:5
    promise callback*t.prototype.updated card-mod.js:5
    _$AE reactive-element.ts:1378
    performUpdate reactive-element.ts:1343
    scheduleUpdate reactive-element.ts:1261
    _$Ej reactive-element.ts:1233
    requestUpdate reactive-element.ts:1208
    set reactive-element.ts:726
    value hui-dialog-edit-card.ts:305
    handleEvent lit-html.ts:2018
    r fire_event.ts:76
    value hui-element-editor.ts:162
    promise callback*value hui-element-editor.ts:161
    value hui-element-editor.ts:397
    value hui-element-editor.ts:128
    value hui-element-editor.ts:122
    j lit-html.ts:1883
    _$AI lit-html.ts:1825
    v lit-html.ts:1192
    g lit-html.ts:1553
    _$AI lit-html.ts:1384
    Z lit-html.ts:2183
    update lit-element.ts:165
    performUpdate reactive-element.ts:1329
    scheduleUpdate reactive-element.ts:1261
    _$Ej reactive-element.ts:1233
    requestUpdate reactive-element.ts:1208
    set reactive-element.ts:726
    value hui-dialog-edit-card.ts:84
    c make-dialog-manager.ts:130
    h make-dialog-manager.ts:163
    r fire_event.ts:76
    o show-edit-card-dialog.ts:18
    value hui-dialog-create-card.ts:213
    handleEvent lit-html.ts:2018
    r fire_event.ts:76
    value hui-card-picker.ts:278
    handleEvent lit-html.ts:2018
    _$AI lit-html.ts:2007
    v lit-html.ts:1192
    g lit-html.ts:1553
[card-mod.js:5:7507](https://haproxmox.ppmt.org/hacsfiles/lovelace-card-mod/card-mod.js?hacstag=190927524315)
Unexpected value NaN parsing height attribute. [apexcharts-card.js:1:187097](https://haproxmox.ppmt.org/hacsfiles/apexcharts-card/apexcharts-card.js?hacstag=331701152204)
Unexpected value NaN parsing height attribute. [apexcharts-card.js:1:381775](https://haproxmox.ppmt.org/hacsfiles/apexcharts-card/apexcharts-card.js?hacstag=331701152204)
Uncaught (in promise) TypeError: o.some is not a function
    updated card-mod.js:5
    promise callback*t.prototype.updated card-mod.js:5
    _$AE reactive-element.ts:1378
    performUpdate reactive-element.ts:1343
    scheduleUpdate reactive-element.ts:1261
    _$Ej reactive-element.ts:1233
    requestUpdate reactive-element.ts:1208
    set reactive-element.ts:726
    value hass-base-mixin.ts:47
    value hass-base-mixin.ts:46
    value home-assistant.ts:150
    _$AE reactive-element.ts:1378
    performUpdate reactive-element.ts:1343
    scheduleUpdate reactive-element.ts:1261
    _$Ej reactive-element.ts:1233
    requestUpdate reactive-element.ts:1208
    set reactive-element.ts:726
    value hass-base-mixin.ts:56
    _updateHass context-mixin.ts:95
    hassConnected connection-mixin.ts:227
    s store.js:19
    b entities.js:74
    b entities.js:76
    _handleMessage connection.js:23
    _handleMessage connection.js:15

@HybridRCG can you test with the latest release if this is still a problem

Hi. The problem is still there. Cleared the cache. New browser. Tried Chrome safari brave Firefox. No luck. 😩

@ppmt those errors seem to be related to card mod. Can you share the error that is printed at the bottom of the card editor

it is the same as @HybridRCG

Can you try with a really simple card config
type: custom:sunsynk-power-flow-card-dev
cardstyle: compact
entities:
  pv1_power_186: sensor.sunsynk_pv1_power
  battery_soc_184: sensor.sunsynk_battery_soc
  battery_power_190: sensor.sunsynk_battery_power
  grid_ct_power_172: sensor.sunsynk_grid_ct_power

I get the same error straight away :(

It could be related to this https://github.com/flixlix/power-flow-card-plus/issues/441

Yes that did it. I removed card-mod and straight away I can access the UI...
Now just have to remember why I installed card-mod to start with...

Hi
I have uninstalled card-mod , cleared cache, tried re-installing the sunsynk card. but still have the same issue. :(
Kind Regards
Riaan Grobler
On 22 Dec 2023, at 10:09, slipx06 @.***> wrote:

Great. @HybridRCG https://github.com/HybridRCG can you confirm the workaround.
I see there is an open issue to track this thomasloven/lovelace-card-mod#321 https://github.com/thomasloven/lovelace-card-mod/issues/321
—
Reply to this email directly, view it on GitHub https://github.com/slipx06/sunsynk-power-flow-card/issues/174#issuecomment-1867368759, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADUQOXFGCK6TYBYMJWLFPKDYKU53BAVCNFSM6AAAAABARKLAVOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRXGM3DQNZVHE.
You are receiving this because you were mentioned.

Ok. You'll need to share some browser console logs in order to understand what is going on.

Hi..
Found the culprit!!
I had browser-mode installed.
Removed it and started working…
Thanks for the help.
Kind Regards
Riaan Grobler

On 22 Dec 2023, at 10:25, slipx06 @.***> wrote:
Ok. You'll need to share some browser console logs in order to understand what is going on.
—
Reply to this email directly, view it on GitHub https://github.com/slipx06/sunsynk-power-flow-card/issues/174#issuecomment-1867382891, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADUQOXFKSHK5LZI2WG2MUCLYKU7WJAVCNFSM6AAAAABARKLAVOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRXGM4DEOBZGE.
You are receiving this because you were mentioned.

Adding back card-mod brings back the problem.
so removed card-mod , browser-mod for the card to work,
Kind Regards
Riaan

On 22 Dec 2023, at 10:25, slipx06 @.***> wrote:
Ok. You'll need to share some browser console logs in order to understand what is going on.
—
Reply to this email directly, view it on GitHub https://github.com/slipx06/sunsynk-power-flow-card/issues/174#issuecomment-1867382891, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADUQOXFKSHK5LZI2WG2MUCLYKU7WJAVCNFSM6AAAAABARKLAVOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRXGM4DEOBZGE.
You are receiving this because you were mentioned.

Glad we figured this out. You'll need to keep an eye on on those two addon's for updates to hopefully fix this.


text:
Handle change kind / review status

Send according events to users and admins
For example, message.kind becomes ADMIN_ONLY

MESSAGE_UPDATED must be sent to ADMINS
MESSAGE_DELETED must be sent to USERS

Fixed

authors: gorobot-nz slntopp

repo: slntopp/core-chatting


text:
shap.TreeExplainer fails when CatBoost has a categorical feature.

Shapley isn't working for some reason and I'm getting incredibly obscure errors. Even though CatBoost is throwing the error it must be because of shap as the CatBoost models still work when called directly. I think the problem is because shap calls get_feature_importance() with a deprecated argument.
The error is
Traceback (most recent call last):
  File "C:/Users/antho/.PyCharm2019.3/config/scratches/scratch_5.py", line 17, in <module>
    shap_values = explainer.shap_values(x)
  File "C:\Users\antho\Miniconda3\lib\site-packages\shap\explainers\tree.py", line 247, in shap_values
    phi = self.model.original_model.get_feature_importance(data=X, fstr_type='ShapValues')
  File "C:\Users\antho\Miniconda3\lib\site-packages\catboost\core.py", line 2322, in get_feature_importance
    fstr, feature_names = self._calc_fstr(type, data, thread_count, verbose, shap_mode)
  File "C:\Users\antho\Miniconda3\lib\site-packages\catboost\core.py", line 1287, in _calc_fstr
    return self._object._calc_fstr(type.name, pool, thread_count, verbose, shap_mode)
  File "_catboost.pyx", line 4084, in _catboost._CatBoost._calc_fstr
  File "_catboost.pyx", line 4114, in _catboost._CatBoost._calc_fstr
_catboost.CatBoostError: c:/goagent/pipelines/buildmaster/catboost.git/catboost/libs/data/model_dataset_compatibility.cpp:47: Feature CHAS is Categorical in model but marked different in the dataset

Process finished with exit code 1

it's probably due to calling a deprecated argument fstr_type='ShapValues'...
File "C:\Users\antho\Miniconda3\lib\site-packages\shap\explainers\tree.py", line 247, in shap_values
    phi = self.model.original_model.get_feature_importance(data=X, fstr_type='ShapValues')

The code required to get this error
import shap
import pandas as pd
from catboost import CatBoostRegressor
from sklearn.datasets import load_boston

bunch = load_boston()
x, y = load_boston(True)
x = pd.DataFrame(x, columns=bunch.feature_names)
x['CHAS'] = x['CHAS'].astype(str)
print(x)

model = CatBoostRegressor(1000, cat_features=['CHAS'], verbose=False)
model.fit(x, y)

if __name__ == '__main__':
    explainer = shap.TreeExplainer(model)
    shap_values = explainer.shap_values(x)

Thanks for noting this! It was because of a problem noting which feature were categorical when converting the dataframe you passed to a Pool object.

repo: slundberg/shap


text:
No module tqdm.auto found here

I believe this is the query being used with in shap package and it gave me this error

I installed tqdm package but that didn't help

What tqdm version do you have? I wonder if we need to specify a specific version dependency

Is this the way seems right to you
From tqdm.auto import tqdm
Or it should be other way round
Sent from my iPhone

On 27-Jul-2019, at 9:48 AM, Scott Lundberg notifications@github.com wrote:
What tqdm version do you have? I wonder if we need to specify a specific version dependency
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

That form matches the tqdm docs
On Fri, Jul 26, 2019 at 10:42 PM Anukriti Gupta notifications@github.com
wrote:

Is this the way seems right to you
From tqdm.auto import tqdm
Or it should be other way round
Sent from my iPhone

On 27-Jul-2019, at 9:48 AM, Scott Lundberg notifications@github.com
wrote:
What tqdm version do you have? I wonder if we need to specify a specific
version dependency
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/slundberg/shap/issues/714?email_source=notifications&email_token=AA4RHRLSS2MF2P5U6XYIUHLQBPN4FA5CNFSM4IGNCBZ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD26EH2Y#issuecomment-515654635,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA4RHRL3QKMZK3EMVMELVX3QBPN4FANCNFSM4IGNCBZQ
.

I am experiencing the same issue, using shap 0.29.3 and tqdm 4.26.0

@johnmccain that's because the use of auto was added in 0.29.2. https://github.com/tqdm/tqdm has that option documented. But if it is breaking for people perhaps we should not be using it. Just to be clear from tqdm.auto import tqdm fails in a blank notebook for your install? How about from tqdm.autonotebook import tqdm?

Same issue here...

I had the same issue, upgrading tqdm fixed it.
pip install tqdm --upgrade

I still have the same issue with shap 0.35 and tqdm4.43.0
when i run the test script, got an error:
from tqdm.auto import tqdm
ModuleNotFoundError: No module named 'tqdm.auto'
pretty sure that shap 0.35 has been successfully install along with tqdm 4.43.0
under: /Library/Python/3.7/lib/python/site-packages/
please help

I had the same issue, upgrading tqdm fixed it.
pip install tqdm --upgrade

Fit for me, thank you!

Can someone find which exact version of tqdm is needed to have this fixed?
But even if not, a fix is available. So I believe this issue can be closed. CC @slundberg

authors: Anu-kriti dorcatty johnmccain jonnor peiyaoli pyaf slundberg wadefall


text:
Rustbinary logs are not written

Steps to reproduce:
Use completion.
Check logs in ..cache\refact\logs.
Expected result:
Logs are written.
Actual result:
There are no logs.
Software versions:
Microsoft Visual Studio Community 2022 (64-bit) - Current Version 17.8.4
Refact plugin v 0.0.1
Windows 11 Pro 22H2 22621.2861

@digital-phoenix

Checked in https://github.com/smallcloudai/refact-vs-classic/actions/runs/7469728225/artifacts/1158463034 - fixed.

repo: smallcloudai/refact-vs-classic


text:
New documentation

The current documentation is quite "minimal".
We need to see how we can improve it:

multi-page
search
landing page

I think this is done

authors: cescoffier jponge

repo: smallrye/smallrye-mutiny


text:
🛑 Portainer Portal Website for Proxmox (tunnel) is down

In abaf078, Portainer Portal Website for Proxmox (tunnel) (https://portainer.sman3palu.sch.id) was down:

HTTP code: 530
Response time: 221 ms

Resolved: Portainer Portal Website for Proxmox (tunnel) is back up in 379e99f after 10 minutes.

repo: smantriplw/uptime-services


text:
Updated all headings and sub-headings

Split all headings and sub-headings into even number of words.
All headings and sub-headings made bold.
Color changes according to respective page color theme.

Fixes #641

Nicw work @itsij

authors: itsij smaranjitghose


text:
React: added the styled components for the content Section

added the styled components for the content Section

Resolve the conflicts

authors: aashimgarg anushbhatia


text:
🛑 Dashboard is down

In c663090, Dashboard (https://app.smart-moov.io) was down:

HTTP code: 502
Response time: 1616 ms

Resolved: Dashboard is back up in 54015cb after 8 minutes.

repo: smart-moov/upptime


text:
What is the proper way to catch "power off" code on AC device?

Actually this is not the issue, but question in order to understand things better, cause I want to contribute here, so I think I can take a freedom to skip providing all these HA version, logs, etc. cause it is not relevant.
First of all, thanks for great integration! It looks very promising. I'm not using it yet cause my AC isn't supported and .json files for supported two models of Beko brand are not working with my model, but I'm preparing to make .json file with codes for my model and once when it being done, upload it here, paid my debt to community, etc. :)
Model is Beko BXK 120:

I am currently using HA remote.learn_command service to catch my codes on all possible combinations (cool auto 16, heat high 31, etc. etc.) and inserting them to 1601.json file instead of existing values, but I am in doubt regarding one thing.
From my understanding, AC remote is working different but TV remote (please correct me if I'm wrong here). When I press e.g. temp+ button on remote, in that code it will not send only "rise temp for 1 degree" data, but will send complete data for all current settings on display, right? (mode, fan speed, temp, etc.)
So finally, the question: Is there some proper way to catch "power off" code or it doesn't matter from which setting I'm turning off AC and catching the code? I mean, I tried to catch the code for power off several times, by pointing AC remote to Broadlink RM Mini 3 while remote.learn_command service is active in HA. I tried this by pressing power button with different mode/fan speed/temp settings on AC remote display every time (e.g. turn of from 16 cool, or turn of from auto mode, etc. etc.). Afterwards, I compared these codes in Notepad++ with Compare plugin - they are all different. Yes, every of these codes will do it's job and will turn off AC from HA via RM Mini 3, but since I intend to send you my .json when being done, I am curious is this proper way at all, or this should be done different?
Thanks

From my understanding, AC remote is working different but TV remote (please correct me if I'm wrong here). When I press e.g. temp+ button on remote, in that code it will not send only "rise temp for 1 degree" data, but will send complete data for all current settings on display, right? (mode, fan speed, temp, etc.)

In most cases, yes.

Afterwards, I compared these codes in Notepad++ with Compare plugin - they are all different.

They are always different. Do not worry. It will work.

Thank you very much, this is also what I supposed, but wanted to confirm with someone from here. Working hours starting now, will try to finish this .json after work and/or tomorrow, testing it little bit and will send you it here.

Another question: My AC have no possibility to change temperature in following modes:

Auto
Dry
Fan

Only fan speed is adjustable in above modes with genuine remote.
Temperature adjustment is possible only in cool and heat mode.
How should I fill .json file for these 3 modes? I was meant that I should omit degrees for these modes and put values directly into fan speed fields, but this is not working with native Thermostat Lovelace card - nothing happens if I press Auto or Dry (there is no Fan mode in native Thermostat card). Should I dummy fill all degrees fields for these modes with same code, no matter that changing temp in these modes will do nothing on AC itself (except probably beep), or there is maybe some smarter way?
.json file can be obtained from here for your reference: https://cloud.stiw47.cloud/s/tCzeSZQoKywWAiX

Should I dummy fill all degrees fields for these modes with same code

Correct

Hi Vasillis, please find complete .json
I tested it, everything is working, model is Beko BXK120
https://cloud.stiw47.cloud/s/P6ArRrpaeFRjaJP
One more question: I opened lot of .json files for other models to examine them, are we have no possibility to setting swing and/or blowing direction?
Thx.

Swing modes can be adjusted. Check out the 1030.json file.

repo: smartHomeHub/SmartIR


text:
HelpdeskBot Network Not Working

This is Bot Development Group
View on Workplace

High priority

fixed

authors: lamnguyentctav smartbiz

repo: smartbiz/HelpdeskBot


text:
Fix code analyzer issues

Fixes issues found in code analyzer
This PR is ready for review.
Risk
This PR makes no API changes.
Testing Plan

Run unit tests
Perform smoke tests

Summary

Fix potential NPEs
Optimize string and string builder usage
Optimize unnecessary reference creation
Fixed duplicate namespace in lockscreen layout
Added Android version checks for specific APIs and constant usage

Bug Fixes

Some of the issues found with the Android Studio code analyzer

CLA

[x] I have signed the CLA

Codecov Report

:exclamation: No coverage uploaded for pull request base (develop@1b57bdc). Click here to learn what that means.
The diff coverage is 5.82%.

@@            Coverage Diff             @@
##             develop    #1179   +/-   ##
==========================================
  Coverage           ?   47.33%
  Complexity         ?     4324
==========================================
  Files              ?      481
  Lines              ?    23359
  Branches           ?     2658
==========================================
  Hits               ?    11058
  Misses             ?    11622
  Partials           ?      679

Impacted Files
Coverage Δ
Complexity Δ

...va/com/smartdevicelink/transport/TCPTransport.java
0% <ø> (ø)
0 <0> (?)

...elink/transport/utl/ByteAraryMessageAssembler.java
44.11% <ø> (ø)
7 <0> (?)

...com/smartdevicelink/transport/TransportBroker.java
23.56% <0%> (ø)
20 <0> (?)

...ink/managers/permission/BasePermissionManager.java
73.04% <0%> (ø)
43 <0> (?)

...com/smartdevicelink/proxy/rpc/OnKeyboardInput.java
94.11% <0%> (ø)
8 <0> (?)

...tdevicelink/managers/video/VideoStreamManager.java
38.69% <0%> (ø)
14 <0> (?)

...smartdevicelink/proxy/rpc/DisplayCapabilities.java
75.51% <0%> (ø)
22 <0> (?)

...main/java/com/smartdevicelink/util/SdlAppInfo.java
37.5% <0%> (ø)
4 <0> (?)

...ink/managers/screen/BaseTextAndGraphicManager.java
49.32% <0%> (ø)
74 <0> (?)

...om/smartdevicelink/transport/SdlRouterService.java
11.79% <0%> (ø)
20 <0> (?)

... and 12 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1b57bdc...31de199. Read the comment docs.

authors: codecov-io joeygrover


text:
fix: simplest example from readme throws NameError

Since args is not defined if len(sys.argv) == 2, simple execution of main.py throws NameError: name 'args' is not defined

@swyxio FYI

This will close #125

thanks @talboren !

authors: swyxio talboren

repo: smol-ai/developer