Feature Request: Unified WebSocket Disconnection Method Across Environments

Hello h3 team,
I am currently leveraging the new WebSocket feature in h3 for integrating GraphQL WebSocket functionalities into my application. While exploring the capabilities and trying to integrate graphql-ws with h3, I encountered a limitation that I believe could be beneficial to address for the wider h3 user community.
Issue Description:
The current WebSocket handler implementation in h3 does not provide a built-in method to close WebSocket connections directly within the handler functions (open, message, close, error). This limitation requires users to access the underlying context (ctx) to close the socket manually. However, the context object's structure is dependent on the runtime environment (e.g., Node.js vs. Bun), leading to a non-uniform approach to closing WebSocket connections. In Node.js environments, the socket can be closed using ctx.node.server, whereas in Bun environments, ctx.bun.ws is used.
A critical aspect of this issue is the behavior observed when exceptions are thrown within WebSocket handlers. Currently, even when an exception is encountered, the WebSocket connection remains active. This behavior can lead to unintended consequences, such as open connections that should have been terminated, reflecting a gap in the error handling and connection management capabilities of h3's WebSocket feature.
Example Scenario:
I was attempting to manually handle GraphQL WebSocket messages using h3's defineWebSocketHandler feature. Upon needing to close the WebSocket connection from within my message handler based on specific conditions, I realized that there wasn't a straightforward way to do this across different environments without directly accessing environment-specific context properties.
Proposed Solution:
It would be highly beneficial if h3 could abstract the environment-specific details and provide a unified way to close WebSocket connections directly within the WebSocket handler functions. A possible solution could involve enhancing the peer object provided to the WebSocket handlers with a method like peer.close(), which internally handles the environment-specific logic for closing the connection.
This enhancement would greatly simplify the development experience, especially for applications that need to run across different JavaScript runtimes and require consistent behavior for managing WebSocket connections.
Potential Benefits:

Simplifies WebSocket management by providing a uniform API across different environments.
Enhances the portability of h3-based applications that use WebSockets, making it easier to run the same application codebase in different JavaScript runtimes.
Improves developer experience by abstracting away the environment-specific details involved in WebSocket connection management.

I believe this feature would be a valuable addition to the h3 library, enhancing its flexibility and ease of use for real-time applications. I am looking forward to your thoughts and feedback on this proposal.
Thank you for considering this feature request.
Additional information

[X] Would you be willing to help implement this feature?

Hello h3 team,
I am currently leveraging the new WebSocket feature in h3 for integrating GraphQL WebSocket functionalities into my application. While exploring the capabilities and trying to integrate graphql-ws with h3, I encountered a limitation that I believe could be beneficial to address for the wider h3 user community.
Issue Description:
The current WebSocket handler implementation in h3 does not provide a built-in method to close WebSocket connections directly within the handler functions (open, message, close, error). This limitation requires users to access the underlying context (ctx) to close the socket manually. However, the context object's structure is dependent on the runtime environment (e.g., Node.js vs. Bun), leading to a non-uniform approach to closing WebSocket connections. In Node.js environments, the socket can be closed using ctx.node.server, whereas in Bun environments, ctx.bun.ws is used.
Example Scenario:
I was attempting to manually handle GraphQL WebSocket messages using h3's defineWebSocketHandler feature. Upon needing to close the WebSocket connection from within my message handler based on specific conditions, I realized that there wasn't a straightforward way to do this across different environments without directly accessing environment-specific context properties.
Proposed Solution:
It would be highly beneficial if h3 could abstract the environment-specific details and provide a unified way to close WebSocket connections directly within the WebSocket handler functions. A possible solution could involve enhancing the peer object provided to the WebSocket handlers with a method like peer.close(), which internally handles the environment-specific logic for closing the connection.
This enhancement would greatly simplify the development experience, especially for applications that need to run across different JavaScript runtimes and require consistent behavior for managing WebSocket connections.
Potential Benefits:

Simplifies WebSocket management by providing a uniform API across different environments.
Enhances the portability of h3-based applications that use WebSockets, making it easier to run the same application codebase in different JavaScript runtimes.
Improves developer experience by abstracting away the environment-specific details involved in WebSocket connection management.

I believe this feature would be a valuable addition to the h3 library, enhancing its flexibility and ease of use for real-time applications. I am looking forward to your thoughts and feedback on this proposal.
Thank you for considering this feature request.
Additional information

[x]  Would you be willing to help implement this feature?

I w

This seems to be the same request as https://github.com/unjs/crossws/issues/23.
Btw, I came across the same use case as you as I also implemented graphql-ws support on top of crossws. It's working great so far, and I will include it in the apollo-server h3-integration package: https://github.com/apollo-server-integrations/apollo-server-integration-h3/pull/65. Would be awesome if you could give it a try and maybe compare the code to what you have. I'm happy to incorporate any feedback.

Lets track via https://github.com/unjs/crossws/issues/23


pkgsMusl.python27Packages.Babel tests fail with unicode error

Issue description
Building pkgsMusl.python27Packages.Babel on latest master fails for me with:
ERROR: test_abort_invalid_po_file (tests.messages.test_pofile.ReadPoTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/Babel-2.7.0/tests/messages/test_pofile.py", line 458, in test_abort_invalid_po_file
    output = pofile.read_po(buf, locale='fr', abort_invalid=False)
  File "/build/Babel-2.7.0/babel/messages/pofile.py", line 377, in read_po
    parser.parse(fileobj)
  File "/build/Babel-2.7.0/babel/messages/pofile.py", line 310, in parse
    self._process_message_line(lineno, line)
  File "/build/Babel-2.7.0/babel/messages/pofile.py", line 210, in _process_message_line
    self._process_keyword_line(lineno, line, obsolete)
  File "/build/Babel-2.7.0/babel/messages/pofile.py", line 222, in _process_keyword_line
    self._invalid_pofile(line, lineno, "Start of line didn't match any expected keyword.")
  File "/build/Babel-2.7.0/babel/messages/pofile.py", line 325, in _invalid_pofile
    print(u"WARNING: Problem on line {0}: {1}".format(lineno + 1, line))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe0' in position 84: ordinal not in range(128)

----------------------------------------------------------------------
Ran 253 tests in 0.432s

FAILED (errors=1)

Relevant code:
https://github.com/NixOS/nixpkgs/blob/e4d1d83f954b24358ee6088e2c2dc7a8b432483d/pkgs/development/python-modules/Babel/default.nix#L14-L20
I think libcLocales is not necessary for musl (see also https://github.com/NixOS/nixpkgs/pull/43666), but I haven't managed to make that test not fail.
Do locales with Python have to be handled differently with musl somehow?
CC @dtzWill

Dropping glibcLocales and the preCheck might be a good idea anyway-- looks like they might not be needed on glibc, at least it seems fine when dropping them locally.
I don't have the deps for this handy (using musl), but the usual fix is to drop glibcLocales if possible (or conditionally include it if needed).  Right now I'm not remembering why pulling in glibcLocales breaks things (instead of simply being unnecessary), but it's easy enough to test regardless ;).
Can you try dropping glibcLocales and the preCheck, see if that helps or changes things?

FWIW now that we include C.UTF-8 locale in glibc, that's almost always better for things like "generic UTF-8 locale for testing" and avoids hardcoding en_US... all without needing to pull in glibcLocales for sake of a reasonable locale.
Treewide cleanup of en_US.UTF-8 (and glibcLocales when it is only pulled in to provide that locale) might be a good idea.

For me it looks like glibcLocales are needed with glibc (normal python27Packages.Babel) -- but not with Python 3, and Python 3 also works with musl without problems.
So it seems to be a Python 2 problem, not a musl problem. I'll make a PR.

PR at #75676.

I think the issue might come from the fact that Python 3 defaults to C.UTF-8, whereas Python 2 to en_US.UTF-8 or something. See https://github.com/NixOS/nixpkgs/issues/20192#issuecomment-303365077
Dropping glibcLocales and setting the locale to C.UTF-8 for Python 2 might fix it.

Dropping glibcLocales and setting the locale to C.UTF-8 for Python 2 might fix it.

@jtojnar This does not suffice for me; with this diff on top of #75676
% git --no-pager diff
diff --git a/pkgs/development/python-modules/Babel/default.nix b/pkgs/development/python-modules/Babel/default.nix
index 7aa743c06b2..8df9bdcf8da 100644
--- a/pkgs/development/python-modules/Babel/default.nix
+++ b/pkgs/development/python-modules/Babel/default.nix
@@ -15,13 +15,17 @@ buildPythonPackage rec {
     # Without this, tests fail with a unicode error on Python < 3
     # (checked with 2.7) if glibc is used, see:
     # https://github.com/NixOS/nixpkgs/issues/74904
-    ++ lib.optionals (!isPy3k && stdenv.hostPlatform.libc == "glibc") [ glibcLocales ];
+    ;

   doCheck = !stdenv.isDarwin
     # Test failure on musl when Python < 3 (checked with 2.7) is used:
     # https://github.com/NixOS/nixpkgs/issues/74904 (like above).
     && !(stdenv.hostPlatform.isMusl && !isPy3k);

+  preCheck = ''
+    export LC_ALL="C.UTF-8"
+  '';
+
   meta = with lib; {
     homepage = http://babel.edgewall.org;
     description = "A collection of tools for internationalizing Python applications";

it still fails with the error on python27Packages.Babel. So it seems glibcLocales is needed on Python 2.7 with glibc.

I pushed d64a456aad9b11628837817d1a64420816bdafcc to python-unstable which hopefully lands in the new staging-next today. Note I did not test with Musl. I could imagine we would need a change in buildPythonPackage instead.


pulley: implement vector shuffle

part of #9783

Do you happen to have something along the Pully pipeline that could use an extra pair of hands? I should probably leave these exercises for others. Btw, this is a wonderful setup for helping people learn about how Pulley works :)

Sure yeah, whatever suits you best! Perhaps the next-lowest-hanging-fruit is performance optimizations which will involve running benchmarks and understanding the performance of Pulley and where hot-spots are. The main goal would be identifying macro-opcodes that can be added for lowering. The first one off the top of my head would be a macro opcode related to bounds checks to make memory accesses faster, but I haven't done performance profiling one way or another on that yet. (we also don't have many docs yet on how to do this so it's a choose-your-own-adventure at the moment, so not necessarily great as a first project)


Question: why re-export tao rather than let the user use tao directly?

Hi,
I'm new to wry and rust in general.
When I read the document, it says that wry re_export tao and I checked the implementation a little bit.
My understanding of the re-exporting is that the user of wry can use wry::application::accelerator.
I'm not sure, but I guess the user of wry can also use tao::accelerator directly.
I'd like to get idea of the re-exporting, is it a pattern in rust world?

i think the main advantage here is that it makes it easy to sync the correct tao version 🤔

As Fabiian said, you need to use the same tao version as the one wry depends on, otherwise the app won't compile because rust treats types from different versions as different so re-exporting eliminates the need to sync versions.


How to compile/install?

This project is great. How can I compile and install it on my Ubuntu 14.04?

Hrm, it seems to me that one should be able to download an Exe or a Elf, or a tar gz and run the program in one easy step, rather than fiddling around for 30 or more minutes chasing wild geese. The whole point of Go (and delphi) is that you download a single Exe and deploy in one step.  These browser based web app type new kids on the block don't seem to understand the whole point of web apps - which was to make the program easy to use - just load up your browser, and boom there your program runs... It seems to me that all these web kits, build instructions, download this, download that, defeats the whole purpose of using a computer. Computers are supposed to make our lives easier, not more difficult.  I will try to work on an installer for all this fragmented nonsense required just to start using a Go IDE - but if anyone has one already or someone is already working on one, let me know.  And yes I know it is not a typical Exe that uses the Win API so it's a bit different, but still - all these hoops you have to jump through just to install Lime Text Editor is pathetic. It's called getting work done - I don't need to know a million things about the build process in order just to start using Go IDE, do I? Oh yes I do.  Consider someone goes to buy a Mac or iPad and instead of providing you with the computer, you have to build it yourself from the solder to the flux, to the capacitors. What is this, gentoo?  The amount of global warming caused by people building stuff they don't need to build...... 3 billion CPU cycles lost to the heat death of the universe..

Except that you are going to be disappointed because the exe/elf etc can not do anything good at the moment except showing some source code and... quit. It's mentioned on the Main Page that the frontend is not ready that.

I installed Lime on my ubuntu 14.04.
As it requires python 3.5 I had to install it through a non-official ppa: http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu
Is it okay to link this ppa in the wiki install page, while no official ubuntu channel has python3.5 ?

@gwenzek: yes, please. I thought it was already, but feel free to add it if it isn't.

@erbridge  done :-)


Attempt to migrate maven pom.xml to gradle #236

less mixins not working ;(
but tests are passing, build seems ok, if you want me to continue - just say a word ;)

@bgalek Please sign the Contributor License Agreement!
Click here to manually synchronize the status of this Pull Request.
See the FAQ for frequently asked questions.

@bgalek Thank you for signing the Contributor License Agreement!

I commented on the commit.

The intention on #236 was not to remove Maven. Just to provide a way for gradle users to play with the project.

@dsyer That's a fast feedback loop! thanks!
I can make it work without removing maven support of course - are you willing to maintain both gradle and pom.xml files? :)

are you willing to maintain both gradle and pom.xml files? :)

Up to a point. If the build.gradle it's broken and I can't fix it I will ask for help. Your name will be top of the list.

Duplicates #385. Neither is mergeable though.

https://github.com/spring-projects/spring-petclinic/pull/385 now seems to be the PR to track. Not much movement since April, but given the review comments I can't blame them


JavaFX

Hello World!!

Merged with a05c7ce71244b477bd23a079dc877a596d9a6771 but GitHub isn't picking it up. You'll still get the shirt though :P


Require a method to Pull all tables from client.

Discussed in https://github.com/Azure/azure-mobile-apps/discussions/439
As per the discussion, it would be good to be able to pull all the tables by only having to call one method as at the moment we need to keep a track of defined tables and iterate through them getting the reference to each and then calling PullItemsAsync.
Maybe have an overloaded method that allows to somehow specify a selection of tables in cases where you don't want to pull all defined tables.

Thinking about this, it's a little hairy in the generalized case.  However, (once the PR happens), you'll be able to write:
await client.PushTablesAsync();
var listOfTables = await store.GetTablesAsync();
foreach (var tableName in listOfTables) {
  var tableRef = client.GetOfflineTable(tableName);
  await tableRef.PullItesmAsync("", new PullOptions());
}

... to pull all items from all tables.  In more complex cases, you will want to set up a map of options/query and table names, then use the query and PullOptions from there (and if not set, assume the basics above).

Looks good, just waiting for the merge.

Merged - will be in next release.

I'm testing this out, can you provide a short example on the more complex cases of pulling only certain tables ? I'm not sure what to pass through to PullOptions.

The method provided gives you a list of all offline tables you have defined.  You get to define what to do with that list.  It's best used when you are pulling "everything" from "everywhere" - in which case the snippet I provided above would be enough.  After that, it's a case of defining the exceptions, then changing the loop to say "if there is an exception, use it; otherwise do the default".

Yes, I imagine it is fine as-is for pulling everything, but what is the query parameter used for. You mentioned in an earlier comment about more complex cases and mapping tables.

The query is an OData filter.  Let's provide an example.  Let's say that you have the following:
Dictionary<string, string> queryMap = new Dictionary<string, string> {
  "table2", "(cacheLocally eq true)",
  "table4": "##do-not-sync##"
};

Dictionary<string, PullOptions> pullOptionMap = new Dictionary<string, PullOptions> {
  "table3", new PullOptions { PushOtherTables = false }
};

The first dictionary maps a table name to an OData query.  The second dictionary maps a table name to the required pull options.  I'm also using a "non-OData" magic string to say "don't sync this table" in the query map.  You can now do the loop:
var listOfTables = await store.GetTablesAsync();
foreach (var tableName in listOfTables) {
  var tableRef = client.GetOfflineTable(tableName);
  string query = queryMap.ContainsKey(tableName) ? queryMap[tableName] : "";
  PullOptions options = pullOptionMap.ContainsKey(tableName) ? pullOptionMap[tableName] : new PullOptions();
  if (!query.StartsWith("##")) {
    await tableRef.PullItesmAsync(query, options);
  }
}

This code allows you to put exceptions in the two dictionaries according to your needs.  If there is no exception, all records will be pulled in an incremental sync manner.  So it's highly flexible.

Thanks for that Adrian.


(whole library) image/icon/avatar will support multiple formats like Asset, Attachment

Summary

Accept multiple formats (eg. Asset, Attachment, or bytes) and read the object conditionally based on the type.
It adds extra time complexity only when users add Asset, Attachment for await avatar.read() else it'll simply pass the bytes which takes no extra time.
Fixed two bugs🐛
All explanations and screenshots are in commit messages

Checklist

[x] If code changes were made then they have been tested.

[x] I have updated the documentation to reflect the changes.

[x] This PR fixes an issue.
[ ] This PR adds something new (e.g. new method or parameters).
[x] This PR is a breaking change (e.g. methods or parameters removed/renamed)
[ ] This PR is not a code change (e.g. documentation, README, ...)

Testing
@group(pass_context=True, aliases=["t"])
async def test(self, ctx: Context):
    """Testing Group commands for bot"""
    if ctx.invoked_subcommand is None:
        await ctx.send('Invalid sub command passed')

@test.command(aliases=["pe"])
async def pfp_edit(self, ctx: Context):
    old_avatar = self.bot.user.avatar
    await self.bot.user.edit(avatar=None)
    await sleep(20)
    await self.bot.user.edit(avatar=ctx.message.attachments[0])
    await sleep(20)
    await self.bot.user.edit(avatar=old_avatar)

@test.command(aliases=["sec"])
async def scheduled_event_create(self, ctx: Context, channel: VoiceChannel):
    await ctx.guild.create_scheduled_event(
        entity_type=ScheduledEventEntityType.voice,
        start_time=ctx.message.created_at+timedelta(minutes=1),
        name="Testing", channel=channel,
        image=ctx.message.attachments[0]
    )

@test.command(aliases=["see"])
async def scheduled_event_edit(self, ctx: Context, event_id: int):
    event = ctx.guild.get_scheduled_event(event_id)
    old_image = event.image
    await event.edit(image=None)
    await sleep(20)
    await event.edit(image=ctx.message.attachments[0])
    await sleep(20)
    await event.edit(image=old_image)

@test.command(aliases=["cr"])
async def create_role(self, ctx: Context):
    await ctx.guild.create_role(
        name="TESTING",
        color=Color.brand_red(),
        icon=ctx.message.attachments[0]
    )
@test.command(aliases=["gc"])
async def guild_create(self, ctx: Context):
    guild = await self.bot.create_guild(
        name="TESTING",
        icon=ctx.message.attachments[0]
    )
    channel = await guild.create_text_channel("demo")
    invite = await channel.create_invite()
    await ctx.author.send(invite.url)

@test.command(aliases=["ge"])
async def guild_edit(self, ctx: Context, guild: Guild):
    await guild.edit(icon=None)
    await sleep(20)
    await guild.edit(icon=ctx.message.attachments[0])
    await sleep(20)
    await guild.edit(icon=ctx.author.display_avatar)

@test.command(aliases=["wc"])
async def webhook_create(self, ctx: Context):
    await ctx.channel.create_webhook(
        name="Testing",
        avatar=ctx.message.attachments[0]
    )

@test.command(aliases=["awe"])
async def async_webhook_edit(self, ctx: Context):
    webhook = find(lambda wh: wh.user.id == self.bot.user.id, (await ctx.channel.webhooks()))
    await webhook.edit(avatar=None)
    await sleep(20)
    await webhook.edit(avatar=ctx.message.attachments[0])
    await sleep(20)
    await webhook.edit(avatar=ctx.author.display_avatar)

This is currently a breaking change since it changes the parameter type.
I don't agree with making the type Asset since it will be harder to use if the avatar is coming from another source such as a saved file or an attachment.
It may be acceptable if it were to accept multiple formats (eg. Asset, Attachment, or bytes) and read the object conditionally based on the type.
I don't know if it's all that necessary as it's not complicated to get bytes from those formats beforehand.

I agree with denver, do remember that webhooks may be used outside of a bot and he standalone

^ Agreed, it could be made optional or something, perhaps

@DenverCoder1  Tell me what you think now. #607

Has this been tested? If yes, please share testing code used.

This is no longer a breaking change since avatar still accepts bytes now.
If this is changed, it should probably also be changed in some or all of the following for consistency:

Webhook.edit
SyncWebhook.edit
ClientUser.edit
Bot.create_guild
Guild.edit
Guild.create_custom_emoji
Guild.create_role?
Guild.create_scheduled_event
ScheduledEvent.edit

It seems like Role.edit and Template.create_guild are a couple more that could be changed

How do you find those subtle changes 😂. Do you memorize everything object and classes of Nextcord?

Mostly just from using Ctrl+F.
To make the original list of methods, I just did a quick search through the API reference docs. Second time, I did a Ctrl+F in the codebase for ": .*:class:bytes" to find all parameters that take bytes. There is one function that takes audio as bytes, but everything else was an image parameter.

@ooliver1  Your turn to review the code. I think everything is ready for merging. I've tested everything and it's working. But you can also double-check.

From a recent poll, it seems like the option to pass File is wanted as it does abstract the step of having to open the file as binary and reading the file, i.e. you'd be able to simply pass File("file.png") instead of open("file.png", "rb").read().

So it seems like SyncWebhook.edit can probably at least take File, and everything else can have File added in addition to the other types.

when you say you have tested, i would appreciate some code so its easier for me to confirm thats the case

when you say you have tested, i would appreciate some code so its easier for me to confirm thats the case

@ooliver1 I haven't tested the newly added commits like:

Template.create_guild,
Role.edit and Guild.create_role because my testing server is not boosted so can't do anything with icon kwarg
SyncWebhook.edit
and the File type support for all image/avatar/icon kwarg

This is all of my testing code so far...
@group(pass_context=True, aliases=["t"])
async def test(self, ctx: Context):
    """Testing Group commands for bot"""
    if ctx.invoked_subcommand is None:
        await ctx.send('Invalid sub command passed')

@test.command(aliases=["pe"])
async def pfp_edit(self, ctx: Context):
    old_avatar = self.bot.user.avatar
    await self.bot.user.edit(avatar=None)
    await sleep(20)
    await self.bot.user.edit(avatar=ctx.message.attachments[0])
    await sleep(20)
    await self.bot.user.edit(avatar=old_avatar)

@test.command(aliases=["sec"])
async def scheduled_event_create(self, ctx: Context, channel: VoiceChannel):
    await ctx.guild.create_scheduled_event(
        entity_type=ScheduledEventEntityType.voice,
        start_time=ctx.message.created_at+timedelta(minutes=1),
        name="Testing", channel=channel,
        image=ctx.message.attachments[0]
    )

@test.command(aliases=["see"])
async def scheduled_event_edit(self, ctx: Context, event_id: int):
    event = ctx.guild.get_scheduled_event(event_id)
    old_image = event.image
    await event.edit(image=None)
    await sleep(20)
    await event.edit(image=ctx.message.attachments[0])
    await sleep(20)
    await event.edit(image=old_image)

@test.command(aliases=["cr"])
async def create_role(self, ctx: Context):
    await ctx.guild.create_role(
        name="TESTING",
        color=Color.brand_red(),
        icon=ctx.message.attachments[0]
    )
@test.command(aliases=["gc"])
async def guild_create(self, ctx: Context):
    guild = await self.bot.create_guild(
        name="TESTING",
        icon=ctx.message.attachments[0]
    )
    channel = await guild.create_text_channel("demo")
    invite = await channel.create_invite()
    await ctx.author.send(invite.url)

@test.command(aliases=["ge"])
async def guild_edit(self, ctx: Context, guild: Guild):
    await guild.edit(icon=None)
    await sleep(20)
    await guild.edit(icon=ctx.message.attachments[0])
    await sleep(20)
    await guild.edit(icon=ctx.author.display_avatar)

@test.command(aliases=["wc"])
async def webhook_create(self, ctx: Context):
    await ctx.channel.create_webhook(
        name="Testing",
        avatar=ctx.message.attachments[0]
    )

@test.command(aliases=["awe"])
async def async_webhook_edit(self, ctx: Context):
    webhook = find(lambda wh: wh.user.id == self.bot.user.id, (await ctx.channel.webhooks()))
    await webhook.edit(avatar=None)
    await sleep(20)
    await webhook.edit(avatar=ctx.message.attachments[0])
    await sleep(20)
    await webhook.edit(avatar=ctx.author.display_avatar)

What are your thoughts on reducing the repetition by making a method in utils to convert objects to base64?
Something like this, for example:
async def _obj_to_base64_data(obj: Optional[Union[bytes, Attachment, Asset, File]]) -> Optional[str]:
    if obj is None:
        return obj
    if isinstance(obj, bytes):
        return _bytes_to_base64_data(obj)
    elif isinstance(obj, File):
        return _bytes_to_base64_data(obj.fp.read())
    else:
        return _bytes_to_base64_data(await obj.read())

That way, everywhere else in the code you'd be able to convert anything to base64 with one line instead of 6 or more.

What are your thoughts on reducing the repetition by making a method in nextcord.utils to convert objects to base64?
Something like this, for example:
async def _obj_to_base64_data(obj: Optional[Union[bytes, Attachment, Asset, File]]) -> Optional[str]:
    if obj is None:
        return obj
    if isinstance(obj, bytes):
        return _bytes_to_base64_data(obj)
    elif isinstance(obj, File):
        return _bytes_to_base64_data(obj.fp.read())
    else:
        return _bytes_to_base64_data(await obj.read())

That way, everywhere else in the code you'd be able to convert anything to base64 with one line instead of 6 or more.

This is creating a circular loop for importing "File" in utils.py any solution?

Why pre-commit.ci is failing -_-

Why pre-commit.ci is failing -_-

sorry, it shouldnt have been enabled until the relevant PR was merged

Probably the last thing. I hope it's not too much...
I think the docstrings might need some updating.
The attributes that were changed probably should not just reference bytes, for example:
- A :term:`py:bytes-like object` representing the webhook's default avatar.
+ A :term:`py:bytes-like object`, :class:`File`, :class:`Attachment`, or :class:`Asset` representing the webhook's default avatar.

And assuming it's targeting 2.1, change info would be nice, for example:
.. versionchanged:: 2.1
    The :attr:`avatar` attribute now accepts :class:`File`, :class:`Attachment`, and :class:`Asset`.


Include CMake build scripts in release archives

Fixes xiph/ogg#35 for future releases.

Merged, thanks.

Hi @tdaede, seems like you only closed the PR and didn't merge the patch or didn't publish the merge.

I can see it here: http://git.xiph.org/?p=ogg.git;a=summary
I'm not sure though which git should be primary at the moment, so I'm paging @ePirat
Regardless, Github is just a mirror and the merge should eventually show up here too.

The mirror bot may need to be re-spun. I didn't get a chance to migrate it before I left Mozilla.


WIP: Sometimes historically visited NFTs component does not appears

Thank you for your contribution to the KodaDot NFT gallery.
👇 _ Let's make a quick check before the contribution.
PR type

[x] Bugfix
[ ] Feature
[ ] Refactoring

What's new?

[ ] PR closes #2977
[ ] <brief_description_of_what_I've_added>

Before submitting Pull Request, please make sure:

[x] My contribution builds clean without any errors or warnings
[x] I've merged recent default branch -- main and I've no conflicts
[x] I've tried to respect high code quality standards
[x] I've didn't break any original functionality
[ ] I've posted a screenshot of demonstrated change in this PR

Optional

[ ] I've tested it at </rmrk/collection/26902bc2f7c20c546a-1FVG7>
[ ] I've tested PR on mobile and everything seems works
[ ] I found edge cases
[ ] I've written some unit tests 🧪

Had issue bounty label?

[x] Fill up your KSM address: Payout

Community participation

[x] Are you at KodaDot Discord?

Screenshot

[ ] My fix has changed something on UI; a screenshot is best to understand changes for others.

pay 50 usd

😍 Perfect, I’ve sent the payout
💵 $50 @ 114.59 USD/KSM ~ 0.436 $KSM
🧗 Caiv9TbPz68q5dC8EcHu5xKYPRnremimGzqmEejDFNpWWLG
🔗 0xbda48dae7d2c66b98366290976b2a9e8a442280cf0a0d1e6ffe8b91c76c56003
🪅 Let’s grab another issue and get rewarded!
🪄 github.com/kodadot/nft-gallery/issues


Make mmap size requested by libmdbx configurable

Describe the feature
I would like there to be a configuration for changing the amount of memory requested upfront by libmdbx through mmap. It is 4TB as of now.
Additional context
Currently, reth requests 4TB of memory with mmap, which fails in Linux environments compiled with no4lvl boot argument. I can see why that would be necessary for production, but I only need to run reth in dev mode, and wouldn't require as much memory.
My use case is running reth in a deterministic RISC-V virtual machine. The application name is Bug Buster.

@shekhirin Hey!
It would be good if the step was also configurable.
From what I understand from the code base, it's at 4 GB.
https://github.com/paradigmxyz/reth/blob/main/crates/storage/db/src/implementation/mdbx/mod.rs#L281-L289

I'm running reth in a really constrained environment. In my use case, I would set the total size to something like 8 MB, and the growth step to something like 4 KB.

I think we can make this work, sorry for not bumping prio on this.
need to track a few other things for this first before we can expose via cli

marking this as completed because this can now be configured


fix: clarify behaviour of influxdb.cardinality()

The functionality of influxdb.cardinality() is not directly analogous to SHOW SERIES CARDINALITY because it's time bounded.
Unlike the InfluxQL command, it reports the cardinality of a specific dataset, but is often the cause of confusion as a result of being interpreted as providing the cardinality of the bucket as a whole.
There are various caveats which need to be considered when using it to obtain the cardinality of the bucket as a whole

start needs to be earlier than the earliest timestamp (some docs pages suggest 1 which is good)
stop needs to be later than the latest timestamp (the default is now() which is problematic if users are writing into the future)
There's a small nuance on replicated systems (such as Cloud2) - the reported value may depend on which replica has respond (results will be eventually consistent, but may not always directly match). Not sure we necessarily need to squeeze that in

Note: a corresponding change will need to be made in the Flux code comments, but I thought it best to work on wording here first.
Describe your proposed changes here.

[ ] Signed the InfluxData CLA
(if necessary)
[x] Rebased/mergeable

I've raised https://github.com/influxdata/flux/pull/5506 to mirror these changes in the Flux comments


farea

Closes #41

@rultor merge

@rultor merge

@yegor256 OK, I'll try to merge now. You can check the progress of the merge here

@rultor merge

@yegor256 Done! FYI, the full log is here (took me 3min)


DOCS-12254-dw-pluck-function-example-kt

DW pluck function example

Closing this PR because the Traceability check did not run at all, despite updating and refreshing the URL many times. Created new PR https://github.com/mulesoft/docs-dataweave/pull/83


Failed loading NodeJS modules

Thanks @jyapayne for great work!
I am having trouble using your application. I have successfully created a windows package but now it says that modules are missing. All modules are inside the project directory. I have successfully tested app with node webkit.
Can you please tell me how do I rectify this problem?

I just downgraded NW version to 0.11.3 and it worked fine for me. But now I am having another problem. The app freezes and doesn't work at all. I got same issue when I run app directly using node-webkit. When I remove "nodejs": false from package.json then app works fine.
Any clue why is it behaving like that?

Hi :)
Usually, that means you might be overwriting some nodejs functions in your JavaScript. However, I'm not certain on this. You could enable the toolbar and check the JavaScript console. It might give you a more complete error message.

Hello @jyapayne,
Thanks for the quick reply. You are right about the error. I am getting require is undefined. I have a following javascript which uses nodejs and javascript.
var gui = require('nw.gui');
var win = gui.Window.get();
var clipboard = gui.Clipboard.get();

global.$ = $;

$(function(){
	$('.minimize-window').click(function(e){
		win.minimize();

	});
});

It works fine with the node-webkit but I am getting an error when I use your app. Any hint how to fix this issue?

Which version are you using, the command line app, or the GUI?

Ah, it looks like I may have misinterpreted the field "node-main" in my application. In the GUI node-main is the "Alt. Nodejs" field. If you fill that field in with your javascript file, does it work?

Hmm, the code you wrote works for me when I tested it. Can I ask, where are you putting that javascript?

I have sent you an email. Thanks

Please update this issue @moazam1. Also, please use Github instead of my email for the back and forth so that others may potentially benefit from similar issues.
Cheers!

I'm closing this issue since I can't reproduce it and you are not responding.
Cheers


AuthorizationRequest can return expired access token, even if valid one is available

There is an issue with the access_token method in Authorization Request
    def access_token
      AccessToken.accessible.where(:application_id => client.id, :resource_owner_id => resource_owner.id).first
    end

There are two potentially issues here:
i) The query itself doesn't exclude expired tokens.  That is, a token where (created_at + expires_in) < Time.now, but that hasn't been explicitly revoked.  That token will still be in the database and can (and often will) be returned in this query.  While this is checked in the request itself, it is possible that this query will return an expired token even if a valid, unexpired token exists in the table.
ii) This method doesn't have an explicit sort, defaulting to the sort of the underlying data store.  As most common databases (MySQL, PostgreSQL, Oracle, etc.) don't guarantee sort results unless an order is specified, this return value is non-deterministic for many data sets.
Handling this in a data-store independent way is a little tricky, as there's no explicit 'expires_at' column in the table on which we can sort.  So the easiest way to do it is probably something like this:
    def access_token
      AccessToken.accessible.where(:application_id => client.id, :resource_owner_id => resource_owner.id).where("created_at >= ?", Time.now - expires_in.seconds).order("created_at DESC").first
    end

This could also be moved into the AccessToken class itself, as a factory method.
Thoughts?

We already have a method in AccessToken which is authorized_for(client_id, ro_id). This basically does query in the first example. The reason for this method is to check whether or not the application was previously authorized (so we can skip the authorization form)
Since (in this case) we need to check only if the user authorized the application, we don't care about the expired tokens. However the order is required here, since later on we check for scope changes in the token, so we need to check scopes in the most recent token.
Thanks for pointing out. I think the ordering would be enough in this case, what do you think?

You're correct about the expiration requirement - as it's being used in the code flow to determine the authorized scopes we will want to include expired tokens in the results.
That said I have some concerns about how this works in practice.  Two issues immediately spring to mind:
Say I have a Doorkeeper app / user combination that has generated 1000+ tokens, almost all of which have expired - when I, as a user, revoke access to that app what precisely happens?  Do I need to revoke all of the expired tokens?
Another potentially problematic use case is that the authorization request will potentially ask for authorization scopes I've already approved.  Imagine the following scenario:
i) Application A requests a token with scopes [:read, :write]
ii) User X is presented with the approval form for :read, :write scopes
iii) User X approves Application A for [:read, :write] and issues a token with [:read, :write]
iv) Application A (say in a mobile form or a different context) requests a token with the more limited scope [:read]
v) As User X's last token has [:read, :write], the user is not presented with an approval form, and the new token with [:read] is issued
vi) Subsequently Application A requests a token with [:read, :write] on behalf of User X
vii) User X will be erroneously be presented with the authorization request form, even though she has already approved both scopes.
These issues probably merit discussion elsewhere.
But, ignoring the above issues for the moment, and assuming that we're using existing tokens to determine approved scopes, then yes, ordering should be sufficient.

In the first scenario, where the user has N number of tokens, I would revoke all tokens. In the current implementation it would make even more sense to remove all tokens from the database, since we don't need them.
In the second scenario, in both cases (v and vii) the user will be presented with the approval form because there was a scope change. The current implementation does not handle the case when the user already approved a wider scope and asks for a narrower one.
As you said, the behaviour of the #7 step is wrong.
The thing that I'm not entirely sure how to handle, is:

Client requests public and write scopes
User authorizes
Time passes...
For some reason, client changes its required scopes only to public
Should the user be prompted with the authorization form or, since he/she already authorized the public scope, the authorization form is skipped?

It seems that the user should always be prompted with the form when there are scope changes. The specs don't mention that though

In the case you describe I don't think that the user should be prompted with the form.  In my mind you're attributing too much importance to the client's required scope, thinking of them as relatively immutable across requests.  In my experience with real world apps that's not generally the case.
Here's a real life example.  I have an application that allows users to authenticate with Facebook and gets some basic permissions (info, sharing on their wall, etc.).  On login it explicitly does not ask for the scope to manage fan pages.  So the scope of the authorization request on login looks something like this: "email,read_stream,publish_stream"
Some of our users want to post content from our application to their fan pages.  This requires 'manage_pages' scope, which wasn't in our original list.  When the user wants to use this functionality, they hit a button which makes an OAuth authorization request to Facebook with scopes "email,read_stream,publish_stream,manage_pages".  Here's how this looks:
i) On first request, the end user is presented with an authorization dialog asking them to grant 'manage_pages' scope
ii) User says yes, new OAuth token is generated and issued
iii) Client code replaces existing token with the new OAuth token, uses it to manage fan pages, get dedicated fan page tokens, etc.
Now time passes, session cookies and tokens expire.  The same end user wants to log back in to the application.  They click the login, which only asks for "email,read_stream,publish_stream" .  This corresponds to a 'scope change' as described in your comment.  Should they be presented with a dialog requesting explicit permissions?
In my view, no.  And Facebook agrees in this case - the end user is not presented with such a dialog in this scenario.  They've already granted these permissions, so there's no need to ask again.
Thoughts?

Thanks for the comment, I haven't thought about this scenario.
What you pointed out makes sense. The current implementation does not work like this, on every scope change the server presents the authorization form.
I'm willing to change it, but I'm wondering if this is the correct idea: after the user authorize one scope, this scope is always granted and does not need to be authorized again, unless the application is revoked.
In this case we have to go through all access tokens for the user/app and merge the scopes to validate against the new scope request. This cover the scenario you mentioned right?

Yes, that would cover this scenario, but may not be ideal.
This is why I'm thinking another model may be required.  The idea of iterating over potentially 1000s of expired tokens to figure out the already authorized scopes seems both inelegant and inefficient.  Introducing a new model - AuthorizedScope - which links a user, an application, and a scope - seems more elegant and should definitely manifest better performance at scale.
Thoughts?

:+1: for better performance. Despite I'm not completely happy with adding one more model (I don't want to pollute the user's database), I would definitely give it a try in a separate branch and see how it looks like.


Cleanup the first chapter

This is kinda WIP in that I haven't actually done a once-over of the changes. Interested in feedback before landing.

All reviews addressed, ready to land.

https://travis-ci.org/rust-lang-nursery/nomicon/builds/260364075#L741

Error unrelated, need @simonsapin's branch to be merged

Fixed.


Won't work on latest gemini: eventData.suiteFullName not exists any more

Gemini 0.11.3.
This line:
return (eventData.suiteFullName.trim() + '.' +
throws error "Cant call method trim() of undefined", because there is no more "suiteFullName" fields. "suiteName" can be used instead

Yeah, eventData.suiteFullName never officially existed. This behaviour has been based on the pull request #131 I made, but has since been closed in favour of return the whole suite in events.
I need to alter the plugin to use that instead.

Okay, thank you. It would be useful for me)

Thanks a lot!

My pleasure :-) Please let me know if you encounter any further issues.


Add note regarding export of nested folders with Apple Mail

Per eesheesh's suggestion in #36

Not sure what happened. I was supposing this was some just GitHub quirk. Will look into this & apologies for the extra work for you! :)

No problem! :) Let me know when I should take another look.

Looks like rebasing did the trick! Should only contain the right commit now.

Thanks! :)


Changed display rotation macro

Earlier it used DISPLAY_ORIENTATION_PORTRAIT and DISPLAY_ORIENTATION_PORTRAIT_INVERTED macro, which is wrong. It doesn't make sense in a ssd1306. It should be DISPLAY_ORIENTATION_LANDSCAPE and DISPLAY_ORIENTATION_LANDSCAPE_INVERTED

I will take it on account after #23 is merged.

I will take it on account after #23 is merged.

Sure no problem.

Sure no problem.

@C47D when will this be merged ?

@VedantParanjape The changes were made in #26 it's now merged, so we can close this PR.


feat: support new big10

Why did we need it?

Related Issue

Release Note

How Has This Been Tested?

Screenshots (if appropriate):

Close since this function not handle error.


Fix license

What problem does this PR solve?
Issue Number: ref #4305
Problem Summary:
What is changed and how it works?
Check List
Tests

[ ] Unit test
[ ] Integration test
[ ] Manual test (add detailed scripts or steps below)
[ ] No code

Side effects

[ ] Performance regression: Consumes more CPU
[ ] Performance regression: Consumes more Memory
[ ] Breaking backward compatibility

Documentation

[ ] Affects user behaviors
[ ] Contains syntax changes
[ ] Contains variable changes
[ ] Contains experimental features
[ ] Changes MySQL compatibility

Release note

None

/merge

/merge


Missing members in the typechain

I have difficulties running the tests.

I installed node artefacts using npm install
I provided one arbitrary privateKey in hardhat.config.ts:22
I ran npx hardhat test

This resulted in the errors below:
test/CakeMaxiWorker.test.ts:9:3 - error TS2724: '"../typechain"' has no exported member named 'PancakeFactory'. Did you mean 'IPancakeFactory'?
test/CakeMaxiWorker.test.ts:10:3 - error TS2724: '"../typechain"' has no exported member named 'PancakeFactoryfactory'. Did you mean 'IPancakeFactoryfactory'?
Are there classes missing or did I do somenthing wrong?
Can anyone publish how to setup this project in order to run the tests?

You will need to run yarn compile to get all contracts compiled and build typechain first before running the tests.


Installation problem - SQL Developer

I followed the 11 steps to install the formatter settings in SQL Developer.
While everything looks fine after uploading the .xml

things seem to get messed up after uploading the .arbori

When formatting a random file using Ctrl-F7, the result looks like in the screenshot above (no formatting, removed line-breaks etc.).
I tried this on fresh installations of SQL Developer 21.4.1 with the same result on both Windows and MacOS.
Am I missing something?

I guess you are using a JDK 8. SQLDev 20.4.x does not work properly with JDK 8. See also #171 and https://community.oracle.com/tech/developers/discussion/4492626/arbori-javascript-callback-functions-do-not-work-in-sqldev-21-4-0-21-4-1-with-jdk8-why .


set login Password

Summary by CodeRabbit

New Features

Introduced a new login flow with enhanced security features.
Added the ability to reset passwords and recover accounts.
Implemented new UI components for password management and recovery.

Improvements

Updated the user interface with additional visual elements and alerts.
Improved the login process with more intuitive steps and feedback.

Bug Fixes

Removed redundant loading simulation logic to streamline user experience.

Refactor

Renamed state variables for clarity and consistency.
Reorganized login and password management code for better maintainability.

Style

Adjusted padding and border styles in the header for a cleaner look.

Documentation

Removed unnecessary code comments to clean up the codebase.

It is scrollable


Zig 0.9.1 update

Some more fixups for Zig 0.9.1 on top of some of @nektro's changes from https://github.com/alexnask/iguanaTLS/pull/27
Most of these additional changes relate to building tests. However, when attempting to build tests with Zig 0.9.0, the compiler crashes during codegen
❯ zig build test
Code Generation [1798/2200] crypto.ecc.muladd_small... broken LLVM module found: Call parameter type does not match function signature!
  %229 = getelementptr inbounds { %"?[]const u8", i16 }, { %"?[]const u8", i16 }* %0, i32 0, i32 0, !dbg !38311
 %"?[]align(8) u8"*  call fastcc void @std.mem.Allocator.resize.431(%"?[]const u8"* sret(%"?[]align(8) u8") %229, %std.mem.Allocator* %2, %"[]u8"* %23, i64 %227), !dbg !38311

This is a bug in the Zig compiler.thread 116721 panic:
???:?:?: 0x5629d097f337 in ??? (???)
???:?:?: 0x5629d18a17bb in ??? (???)
???:?:?: 0x5629d18c86a2 in ??? (???)
???:?:?: 0x5629d18cd7cd in ??? (???)
???:?:?: 0x5629d189d48f in ??? (???)
???:?:?: 0x5629d0d71884 in ??? (???)
???:?:?: 0x5629d0d3374a in ??? (???)
???:?:?: 0x5629d0b16135 in ??? (???)
???:?:?: 0x5629d0b09362 in ??? (???)
???:?:?: 0x5629d0b04f01 in ??? (???)
???:?:?: 0x5629d0a93b7f in ??? (???)
???:?:?: 0x5629d09adb8d in ??? (???)
???:?:?: 0x5629d097db76 in ??? (???)
???:?:?: 0x5629d097d309 in ??? (???)
???:?:?: 0x7f18ae251b24 in ??? (???)

edit: update Zig 0.9.0 -> 0.9.1

Also pinging @marler8997, who may also be interested in these changes

Closing in favour of https://github.com/alexnask/iguanaTLS/pull/27


[docs] create theming page

Create a theming page of how to override future <rh-surface> element to provide different background colors while maintaining accessibility concerns.

NB: surface and theming are related but separate issues
Surfaces exposes a themed context as an element
You can theme a colour context, and this is the primary way you should theme the design system
See #1298 which will close this issue


Help Wanted: Localization

I call upon anyone that wants to farm some green boxes for their github profile or just like to contribute in general.
Feel free to submit incomplete or new languages.
Status

Language
Coverage

✔
English

✔
Dutch

✔
German

❌
Russian
71%

❌
Turkish
71%

Beginners' Guide
All localization files are located in src/main/resources/assets/autorun/lang.
The language files are named by their locale code as listed on the Minecraft Wiki.
If you want to submit localization for an uncovered language duplicate and rename en_us.json, which is the reference language for this mod.

Is this still open?

Is this still open?

Yes.

Please add my russian translation


Can't import SDWebImage when using latest CocoaPod installation

Please see here for more info: http://stackoverflow.com/questions/29329170/import-sdwebimage-fails-despite-cocoapod-installation
Something doesn't seem to be right. I even deleted all pods and reinstalled everything.

What do you see when you are typing pod search SDWebImage in the shell?

Looks like the StackOverflow question was answered.


Blocked well add interpretation and feature convenience

Added convenience function to quickly create wellbore interpretation and wellbore feature objects for a blocked well object.
Other minor bug fixes.

Codecov Report

Merging #49 (9432fb6) into master (5a89049) will decrease coverage by 0.01%.
The diff coverage is 23.07%.

@@            Coverage Diff             @@
##           master      #49      +/-   ##
==========================================
- Coverage   34.09%   34.07%   -0.02%
==========================================
  Files          48       48
  Lines       21531    21535       +4
==========================================
- Hits         7340     7339       -1
- Misses      14191    14196       +5

Impacted Files
Coverage Δ

resqpy/well.py
27.49% <23.07%> (-0.07%)
:arrow_down:

resqpy/olio/weights_and_measures.py
29.05% <0.00%> (-0.61%)
:arrow_down:

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 5a89049...9432fb6. Read the comment docs.

Added two comments for suggested tweaks, up to you whether to change. Otherwise looks good!

I think I've accepted them both, good spot on the nested_tags_text and missing docstring, thanks!


Network tab

https://news.ycombinator.com/item?id=17581719
this is a thing i've always wanted that i've never known i've wanted until now. seems like it should be possible given that this is dev tools ripped out of chrome but of course i'm not sure given how massively complex this project is. just wondering.
thanks for the work!

@patrickhulce I would say both? A node server is a good use case where you want to see incoming requests to your server and outgoing requests made by the app/backend. Points for being able to filter between incoming/outgoing requests.

Literally first thing I looked for after seeing the post on HN.
@patrickhulce Both if possible, it’d be a complete life saver to see the requests as they fly in and out, rather than debugging just the payload before/after flight, or proxying the requests through another app.

Yeah makes sense I've just been thinking lately that it'll require a completely new UX. I'd love to see incoming routes with a breakdown of time spent in each middleware, incoming request, final response body, etc. I could see the existing network panel being extremely confusing if outgoing and incoming were intermingled (it's already bad enough when you're trying to look at a service worker page 😆)

If it's easier to just add in outgoing requests that would be really helpful.

We are working on this feature request. Stay tuned.

@ak239 I'm interested in this feature, is there a way I can help?

I was hacking around to make it work. Stay tuned!!!!

This would be a fantastic feature!

any workarounds for getting this will be amazing

@a7madgamal WIP fork https://github.com/khanghoang/ndb#master

I'm thrilling to announce that I'm working on WIP PR for this #282

想知道进度。。。


fix kernel cflags for loongarch

The arch should return loongarch in loongarch64 machine, but it return loongarch64, because it is loongarch in kernel source tree.

Checklist

[x] Language changes are updated in man/adoc/bpftrace.adoc and if needed in docs/reference_guide.md
[x] User-visible and non-trivial changes updated in CHANGELOG.md
[x] The new behaviour is covered by tests

Could you please fix the clang-format issue? Thanks!

OK, I modified it according to the clang-format prompt, thanks!


Use NullableEnumValidator for enum

Was a bit too quick on merging PR #1463

Pull Request Test Coverage Report for Build<PHONE_NUMBER>

0 of 0   changed or added relevant lines in 0 files are covered.
No unchanged relevant lines lost coverage.
Overall coverage remained the same at 97.063%

Totals

Change from base Build<PHONE_NUMBER>:
0.0%

Covered Lines:
2842

Relevant Lines:
2928

💛  - Coveralls


Messy Formatting

My Gmail HTML Mailbox has very weird formatting. All text is pushed to the left side of the screen, and feels really unnatural to read.
Some of the signatures are centered, so the body is to the left, signatures center.

The 6.6xx versions are our stable versions and all 6.7xx are beta versions for previewing latest mostly stable changes to the project.

This should be solved by the theming changes for Material 3.


🐛 Media directory is not adjusted in Mopidy, when changed in install script

Bug
What I did
I changed my default media directory in the installation script to /media/usb.
What happened
The new directory is used in the Phoniebox configuration, but not adjusted in /etc/mopidy/mopidy.conf. I have to change it manually.
I expected this to happen
The configuration file of Mopdiy should be automatically adjusted.
Further information that might help
I use the following command in my documentation to change this: sudo sed -i -e 's=/home/pi/RPi-Jukebox-RFID/shared/audiofolders=/media/usb=g' /etc/mopidy/mopidy.conf
Software
Phoniebox 2.1.1
Installscript
scripts/installscripts/buster-install-default.sh

If you want, you can add a PR for the changes in the install script.

Theoretically yes, but I cannot verify this for the 3 other install scripts. I also have no automated test for this. So I have to install from scratch for every test. This is a little annoying.
I think it has to be something like in line 910-933 of the buster-install-default.sh, which is relative easy to replicate for the media folder. I think the sample has to be replaced, too (https://github.com/MiczFlor/RPi-Jukebox-RFID/blob/develop/misc/sampleconfigs/mopidy-etc.sample) - I think this is easy, when having a full setup for development. But I don't have one, yet. So it may be I can change this for my own fork in the buster-install script, but I cannot guarantee it will work.

Thanks for the pointers, I'll look into it.


how to run django app and qcluster in separate docker containers

Hi,
I'm using docker-compose to containerize two services, the main app service to queue tasks  and the qcluster service to create qcluter. I'm using sqlite orm as a the borker. It is shared between the two services.
Docker-compose file:
version: '3.8'
services:
  appseed-app:
    container_name: appseed_app
    restart: always
    env_file: .env
    build: .
    volumes:
      - dbdata:/app
    networks:
      - db_network
      - web_network
  qcluster:
    container_name: qcluster
    restart: always
    env_file: .env
    command: python manage.py qcluster
    build: .
    volumes:
      - dbdata:/app
    networks:
      - db_network
      - web_network
  nginx:
    container_name: nginx
    restart: always
    image: "nginx:latest"
    ports:
      - "5085:5085"
    volumes:
      - ./nginx:/etc/nginx/conf.d
    networks:
      - web_network
    depends_on:
      - appseed-app
networks:
  db_network:
    driver: bridge
  web_network:
    driver: bridge
volumes:
  dbdata: {}

setting.py file:
Q_CLUSTER = {
   'name': 'mycluster',
   'workers': 4,
   'recycle': 50, # The number of tasks a worker will process before recycling . Useful to release memory resources on a regular basis. Defaults to 500.
   'timeout': 1000, #The number of seconds a worker is allowed to spend on a task before it’s terminated
   'retry': 1200, # The value must be bigger than the time it takes to complete longest task, i.e. timeout must be less than retry value and all tasks must complete in less time than the selected retry time
   'queue_limit': 50,
   'label': 'Django Q2',
   'catch up': False,
   'bulk': 10,
   'orm': 'default',
   'sync': False,
   'ack_failures': True,
   'ack_warning': False,
   'orm_check': True,
}

# cache for django-q --> python manage.py createcachetable
CACHES = {
   'default': {
       'BACKEND': 'django.core.cache.backends.db.DatabaseCache',
       'LOCATION': 'my_cache_table',
   }
}

The Problem:
It seems that even though the cluster is setup in the qcluster container, It's not accessible/visible in the main app service. Not sure what I'm missing.
Thanks for you patience.

@AnanyaP-WDW That's correct. Django Q2 runs isolated from the main app (except for the connection to the database). I am not sure what you want to access here.

When you add new tasks, the cluster will pick them up by itself. You don't need to do anything for that. So I am not sure what the issue is here. Can you share how you create tasks?

This is how i'm creating tasks. This is inside a view
async_task(run,                      var_a,                      var_b,                      group = job_id,                     hook = q_result_hook                     )
The thing is when I run the main app without docker the q works. But as soon as I make separate containers the q refuses to pick tasks.
Some more information:

I've checked network between the containers.
I've checked that both services have access to the db.
There is a cache table in the db
A valid cluster gets created in the qcluster container
A valid task is queued in the main app cluster


Issue 82

#82

Coverage decreased (-1.6%) to 88.186% when pulling ed93c6d38f97c13f06fd3f2210aabde4ad898f9d on issue-82 into d93eee49e09ee183909d6f7be0cc1b380b69f6d3 on master.

Ready for review.

find by tag is a awesome feature!!!

Y U NO UNIT TEST THO???


add ability to get the currently active configuration in a detox test

This is a feature request, please see the SO question for details.

It's been awhile since this issue was opened. However, if that's still relevant for you or for anyone else I encourage you to open this issue again.
Also, as it was answered in the SO post: https://stackoverflow.com/a/49426119/11686340, you can access the configuration argument in a non-official way. If you are reading this comment and this is relevant for you in any way please write us the use-case you're trying to solve and maybe there's a better way to do this (or we'll set you with one).

We've recently had a use case for this.
In our tests we used test values that needed to change based on the app Build Type. Specifically Branch deep links that we are passing to detox.device.openUrl to test deep linking functionality. Debug builds need Branch Test links, and Release builds need Branch Live links.
The non-official solution linked above does not work anymore in version 20. What we've done instead is check an environment variable that's set in our build scripts and change the links used appropriately

@phillip-kic it is quite trivial to get the current configuration in Detox 20:
https://wix.github.io/Detox/docs/api/internals/#config-runtimeconfig
https://github.com/wix/Detox/blob/ba39bbb92469425d7d70717c5f180da584e6756b/detox/internals.d.ts#L246


Add GET /connections/:id support

Second pass without the sensitive information. I messed up something with git in the last one 🤦♀ and deleted all the mentions of the sensitive info.

Codecov Report

Merging #72 (0a5a70d) into master (dae3376) will increase coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master      #72      +/-   ##
==========================================
+ Coverage   98.21%   98.24%   +0.02%
==========================================
  Files          20       20
  Lines         393      398       +5
==========================================
+ Hits          386      391       +5
  Misses          7        7

Impacted Files
Coverage Δ

lib/workos/sso.rb
95.31% <100.00%> (+0.39%)
:arrow_up:

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 dae3376...0a5a70d. Read the comment docs.

Codecov Report

Merging #72 (0a5a70d) into master (dae3376) will increase coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master      #72      +/-   ##
==========================================
+ Coverage   98.21%   98.24%   +0.02%
==========================================
  Files          20       20
  Lines         393      398       +5
==========================================
+ Hits          386      391       +5
  Misses          7        7

Impacted Files
Coverage Δ

lib/workos/sso.rb
95.31% <100.00%> (+0.39%)
:arrow_up:

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 dae3376...0a5a70d. Read the comment docs.


Impruvment of parallel work

Improvement of duplicates in parallel work. Previous realization did duplicates in parallel work.
Issue #, if available:
In parallel work function duplicates output if you use DataLoader with num_workers > 1
Description of changes:
Added functionality to check on parallel work. If solution works in parallel than we take number of workers and each worker returns unique sequence.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Please tag this pr with at least one of these labels to make our release process faster: BREAKING, new feature, bug fix, other change, dev setup

Hi @Alex2251, thanks for this! By the looks of it, this might be related to #2594?
To fix the style checks failures:
pip install -U black
black src test

and commit the changes

Hi @lostella! Thanks for comment and this commit will solve #2594.

@Alex2251 while this fixes #2594, each worker will still process each entry it needs to skip, and will slow down because of it. The downstream network will not be invoked (and there may be some time saving because of it), but any lazy transformation will still be applied to each element of the dataset. I think this was also pointed out by @gorold in this comment

@lostella Yes it is. I tried to explaine my opinion in #2594, I think it is critical bug because you have a lot of the same batches.

I wonder if we should use that DataLoader at all.
As I understand it, it does three things:

collect inputs into batches
stack those batches
turns things into torch.tensor

That's something we can easily do ourselves and in fact already do elsewhere.

Additionaly this DataLoader prevent duplicates, today there are duplicates. It shuld be prevented to use such dataloader because many people and me first time thought that it works from a box in a right way in parallel mode.

I think @jaheba means torch’s DataLoader: whatever we use, as long as the data is accessible only as an iterable stream, if multiple processes are to be used then there must be some logic to handle it. I’m not sure that avoiding torch’s DataLoader buys us anything.
The solution in this PR solves an issue, but it’s not ideal. The ideal solution, as pointed out, is either to rely on a “map” (“indexable”) dataset, or at least on a dataset type that can be sharded so that each process iterates its own shard: we used to have something like the latter, but it was arguably a bit clunky.

@jaheba what torch’s DataLoader buys us, I think, is to be able to use PyTorch Lightning: whether one likes it or not, I think it’s better than having to maintain our own training loop.
The best code is no code!

I agree.

@jaheba what torch’s DataLoader buys us, I think, is to be able to use PyTorch Lightning: whether one likes it or not, I think it’s better than having to maintain our own training loop.
The best code is no code!

That's just not true.

torch's DataLoader helps handle the multiprocessing for datasets! It's really important for larger batch sizes and can speed up training by 10x (assuming the underlying dataset is sharded properly). Implementing custom dataloading tooling which supports multiprocessing and interops with pytorch lightning (and all the accelerators, e.g. deepspeed, ddp, etc.) may be quite complicated.

We have had bad experiences when using multiprocessing for loading data in the past and have therefore removed it. Our current strategy is to make the data-loading pipeline as fast as possible, and looking at parallelising it in the future.
Something we should do is to have some simple benchmarks to look at pipeline throughput, so that we actually have some numbers that we can talk about.

We've removed the DataLoader in #2628.
I am going to create an issue to track the re-introduction of parallelised data loaders.


[x86] RyuJIT jitting crash

From @BredPet on April 10, 2018 16:12
I try to compile some sample by ILC(CoreRT) compiler for ARM in cross mode. In debug mode there is no problem, but in release with -O3 there is an issue in dllimport.
Backtrace:
#0  LoadLibErrorTracker::LoadLibErrorTracker (this=<optimized out>) at /coreclr/src/vm/dllimport.cpp:5720
#1  NDirect::NDirectLink (pMD=0xeea15880) at /coreclr/src/vm/dllimport.cpp:6331
#2  0xf76295e0 in NDirectImportWorker (pMD=0xeea15880) at /coreclr/src/vm/dllimport.cpp:6469
#3  0xf75bb67e in NDirectImportThunk () at /coreclr/src/inc/ex.h:1459
#4  0xeea15880 in ?? ()
#5  0xefcdeb86 in ?? ()
#6  0xefcde0ff in ?? ()
#7  0xf61112d2 in ?? ()
#8  0xf6b43911 in ?? ()
#9  0xf75bb5da in CallDescrWorkerInternal () at /coreclr/src/inc/ex.h:1459
#10 0xf74e8303 in CallDescrWorkerWithHandler (fCriticalCall=0, pCallDescrData=<optimized out>) at /coreclr/src/vm/callhelpers.cpp:78
#11 MethodDescCallSite::CallTargetWorker (this=0xffffc278, pArguments=0xffffc240, pReturnValue=0xffffc270, cbReturnValue=8) at /coreclr/src/vm/callhelpers.cpp:620
#12 0xf75e0195 in MethodDescCallSite::Call_RetArgSlot (this=0xf7f97884, pArguments=0xf3607710) at /coreclr/src/vm/callhelpers.h:433
#13 RunMain(MethodDesc*, short, int*, PtrArray**)::$_0::operator()(RunMain(MethodDesc*, short, int*, PtrArray**)::Param*) const::{lambda(RunMain(MethodDesc*, short, int*, PtrArray**)::Param*)#1}::operator()(RunMain(MethodDesc*, short, int*, PtrArray**)::Param*) const (pParam=0xffffc208, this=<optimized out>) at /coreclr/src/vm/assembly.cpp:1709
#14 RunMain(MethodDesc*, short, int*, PtrArray**)::$_0::operator()(RunMain(MethodDesc*, short, int*, PtrArray**)::Param*) const (__EXparam=0xffffc208, this=<optimized out>)
    at /coreclr/src/vm/assembly.cpp:1720
#15 RunMain (pFD=0xf7f97884, numSkipArgs=1, piRetVal=0xffffc334, stringArgs=0xffffc620) at /coreclr/src/vm/assembly.cpp:1720
#16 0xf75e0433 in Assembly::ExecuteMainMethod (this=0x80a0ef0, stringArgs=0xffffc620, waitForOtherThreads=1) at /coreclr/src/vm/assembly.cpp:1817
#17 0xf741d960 in CorHost2::ExecuteAssembly (this=0x805cc18, dwAppDomainId=1, pwzAssemblyPath=0x809f488 u"/arm_target_dir_x86_release/ilc.dll", argc=4, argv=0x80a37f0,
    pReturnValue=0xffffc6e4) at /coreclr/src/vm/corhost.cpp:491
#18 0xf73f73c8 in coreclr_execute_assembly (hostHandle=0x805cc18, domainId=1, argc=4, argv=0xffffc93c, managedAssemblyPath=0x8052a48 "/arm_target_dir_x86_release/ilc.dll",
    exitCode=0xffffc6e4) at /coreclr/src/dlls/mscoree/unixinterface.cpp:407
#19 0x0804aae4 in ExecuteManagedAssembly (currentExeAbsolutePath=0x8052a10 "/arm_target_dir_x86_release/corerun",
    clrFilesAbsolutePath=0x8052a80 "/arm_target_dir_x86_release", managedAssemblyAbsolutePath=0x8052a48 "/arm_target_dir_x86_release/ilc.dll",
    managedAssemblyArgc=4, managedAssemblyArgv=0xffffc93c) at /coreclr/src/coreclr/hosts/unixcoreruncommon/coreruncommon.cpp:429
#20 0x080499a9 in corerun (argc=6, argv=0xffffc934) at /coreclr/src/coreclr/hosts/unixcorerun/corerun.cpp:149
#21 0x08049b5f in main (argc=6, argv=0xffffc934) at /coreclr/src/coreclr/hosts/unixcorerun/corerun.cpp:161

asm:
   0xf7627a00 <+128>:   call   0xf74689c0 <MethodDesc::EnsureActive()>
   0xf7627a05 <+133>:   add    $0x10,%esp
   0xf7627a08 <+136>:   mov    -0x15c4(%ebx),%eax
   0xf7627a0e <+142>:   movaps -0x1a69f0(%ebx),%xmm0
   0xf7627a15 <+149>:   movl   $0x10,-0x298(%ebp)
   0xf7627a1f <+159>:   mov    %eax,-0x294(%ebp)
=> 0xf7627a25 <+165>:   movaps %xmm0,-0x2a8(%ebp)

it's strange bug, if I allocate LoadLibErrorTracker by "new" instead just on stack, issue is disappeared.
In other working places esp value like 0xffffbc30, aligned 8.
In this case: 0xffffbc44
C# code in CoreRT part in CorInfoImpl:
jitStartup(GetJitHost(_jitConfig.UnmanagedInstance));
_jit = getJit();

If i change it as:
_jit = getJit();
jitStartup(GetJitHost(_jitConfig.UnmanagedInstance));

issue also disappeared ;-)
I guess it's maybe wrong stack padding somewhere.
@jkotas please take a look
Copied from original issue: dotnet/coreclr#17495

From @mikedn on April 10, 2018 16:31

In other working places esp value like 0xffffbc30, aligned 8.

You mean aligned 16, movaps expects that.

I guess it's maybe wrong stack padding somewhere.

Most likely. AFAIR the native x86 Linux compiler(s) expect the stack to be 16 bytes aligned these days and some VM code likely fails to maintain alignment.

This looks like a calling convention mismatch (stdcall vs. cdecl) in CoreRT.
From cursory review, the fix may look like something like this: https://github.com/jkotas/corert/tree/callconv (I have not tested this).

Ok, I'll take a look. I fixed some callconv-s in CoreRT too, while fixing release mode. Maybe I missed something.

I fixed eeMemoryManager too one week ago ;-) No, it doesn't fix this issue, but I'll look for other similar places.

I found. I will prepare the corresponding PR. This was the last nail for x86->arm HelloWorld release build(CoreRT, CoreCLR, CoreFX) with -O3) We forgot about dllmport attributes in C#, by default it loads funcs with non-stdcall attribute in CoreRT, but some funcs with this attribute in CoreCLR.


How Do You Use This?

There are no instructions after install. After adding the "Add-On" to Anki 2.1.39 you can see it in the Add-On section, but then what? There are no other options to perform any actions.

tools > import memrise course


Add time formatters for days with ordinal suffix. Includes specs and docs.

This PR depends on the methods added in #5054, and so cannot be merged
unless #5054 is merged first.

Also depends on ICU, should be extracted as shard. I was started crystal-cldr but have no time to finish it yet.

This is not common so I'm not sure we should merge this.
Do any other language provide this functionality?

It should be extracted as separate shard anyway. It's related to Unicode CLDR.


Minor code cleanup

ReSharper noticed some minor issues e.g. out of sync XML doc comments and unused private methods.

@andrewdavey I'm really sorry this has gone unmerged for 6 years, any chance you can fix the conflicts and I'll get this merged in.


Hide oldest unmaintained releases cycles using javascript

I don't know if it makes things more accessible, but at least people that disabled JavaScript on their browser can now see all release cycles.
A small glitch can sometime be observed on page load (for example on API Platform page) but that's not systematic and I didn't consider that to be an issue.
This PR relates to #50.

The only other solution that I can think of would be to duplicate all the hidden rows, and keep them inside a <noscript> tag - So extra rows are always hidden, but a copy is shown in case Javascript is disabled.
But that might cause other issues I think? This looks like a reasonable solution.

But that might cause other issues I think? This looks like a reasonable solution.

Can't think of other issues, but we would have to duplicate all the gymnastic done around releases in the product template. So I would advise against that solution for such a minor issue.
The other solution is to do nothing and document somewhere why we choose to hide the old rows by default and the drawbacks of that solution.


Sheets API: Creating a basic filter for a sheet first column is not working

Environment details

OS: N/A
PHP version: 7.3.5
Package name and version: google/apiclient:^2.0

Steps to reproduce

Turn off the filters in the sheet.
With the quickstart [1] implementation to get the client, run the below code.

Expected behavior:
It should create a filter for the first column of the sheet.
Actual behavior:
It doesn’t create the filter and throws the following error:
Fatal error: Uncaught Google_Service_Exception: {
"error": {
"code": 400,
"message": "Invalid value at 'requests.set_basic_filter.filter' (Map), Cannot bind a list to map for field 'criteria'.",
"errors": [
{
"message": "Invalid value at 'requests.set_basic_filter.filter' (Map), Cannot bind a list to map for field 'criteria'.",
"reason": "invalid"
}
],
"status": "INVALID_ARGUMENT"
}
}
Code example
# example
$client = getClient();
$service = new Google_Service_Sheets($client);

$body = new Google_Service_Sheets_BatchUpdateSpreadsheetRequest(array(
'requests' => array(
    'setBasicFilter' => array(
        'filter' => array(
            'range' => [
                'sheetId' => 0,
                'startColumnIndex' => 0,
                'endColumnIndex' => 0
            ],
            'criteria' => array(
                '0' => array(
                    'condition' => array(
                        'type' => 'TEXT_EQ',
                        'values' => array(
                            'userEnteredValue' => 'global_city_actors'
                        )
                    )
                )
            )
        )
    )
)
));

var_dump($service->spreadsheets->batchUpdate("[SPREADSHEET-ID]", $body));

Additional information:

I only tested the request with the condition type “TEXT_EQ”.
Useful information [2][3].
Making the same request directly from “Try this API” does work as expected, creating the filter in the first row [4].

[1] https://developers.google.com/sheets/api/quickstart/php
[2] https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/request#setbasicfilterrequest
[3] https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/sheets#BasicFilter
[4] https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/batchUpdate?apix_params={"spreadsheetId"%3A"1-0mnkH5HORTy-FJ3WEY5TOl1fa7wUGLNsuQPtahqGUA"%2C"resource"%3A{"requests"%3A[{"setBasicFilter"%3A{"filter"%3A{"range"%3A{"sheetId"%3A0%2C"startColumnIndex"%3A0%2C"endColumnIndex"%3A0}%2C"criteria"%3A{"0"%3A{"condition"%3A{"type"%3A"TEXT_EQ"%2C"values"%3A[{"userEnteredValue"%3A"global_city_actors"}]}}}}}}]}}

Seems like using stdClass works for me?
$criteria = new stdClass;
$criteria->{'0'} = array(
    'condition' => array(
        'type' => 'TEXT_EQ',
        'values' => array(
            'userEnteredValue' => 'global_city_actors'
        )
    )
);
$body = new Google_Service_Sheets_BatchUpdateSpreadsheetRequest(
    array(
        'requests' => array(
            'setBasicFilter' => array(
                'filter' => array(
                    'range' => [
                        'sheetId' => 0,
                        'startColumnIndex' => 0,
                        'endColumnIndex' => 0
                    ],
                'criteria' => $criteria
                )
            )
        )
    )
);

var_dump($service->spreadsheets->batchUpdate($spreadsheetId, $body));

Hope it helps!


Update scalafmt-core to 3.2.2

Updates org.scalameta:scalafmt-core from 3.2.1 to 3.2.2.
GitHub Release Notes - Version Diff
I'll automatically update this PR to resolve conflicts as long as you don't change it yourself.
If you'd like to skip this version, you can just close this PR. If you have any feedback, just mention me in the comments below.
Configure Scala Steward for your repository with a .scala-steward.conf file.
Have a fantastic day writing Scala!

Files still referring to the old version number
The following files still refer to the old version number (3.2.1).
You might want to review and update them manually.
project/Dependencies.scala
src/sbt-test/sbt-jgiven-scalatest-reporter/simple/project/Dependencies.scala

Ignore future updates
Add this to your .scala-steward.conf file to ignore future updates of this dependency:
updates.ignore = [ { groupId = "org.scalameta", artifactId = "scalafmt-core" } ]

labels: library-update, early-semver-patch, semver-spec-patch, old-version-remains, commit-count:1

already updated


Overlapped equations in Google Chrome >7 for Windows

I have noticed that most of the equations look at times (most often than not) overlapping each other. Mainly, this happen in http://math.stackexchange.com/ and http://physics.stackexchange.com/ and only in Windows (Chrome for Ubuntu works alright).

Labeled "Do not Write Unit test" because IIUC it depends on Web fonts being load for the first time or not and it's hard to include such a test case in our testing framework.


chore: adding license

Description
Adds the project LICENSE, mirroring the Flutter's one.
Type of Change

[ ] ✨ New feature (non-breaking change which adds functionality)
[ ] 🛠 Bug fix (non-breaking change which fixes an issue)
[ ] ❌ Breaking change (fix or feature that would cause existing functionality to change)
[ ] 🧹 Code refactor
[ ] ✅ Build configuration change
[ ] 📝 Documentation
[x] 🗑 Chore

Just as a note, this contradicts the license mentioned in some of the READMEs with badges: https://github.com/flutter/io_flip/blob/main/README.md?plain=1#L8


can't do more than one shard

Heroku is not suitable for clustered sharding. If your bot isn't in more than a few servers, edit index.js options to clusters: 1.

can you show me where I would find that option

@Keterr


Print syntax errors

TL;DR: Printing complete stacktrace/error when formatter fails would be tight. ✨
When running :MixFormat on a file that contains syntax errors, the error reported [by neovim in my case] appears to be the final error in the stack:
    (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3

Running mix formt [FILE] from a shell window reports:
mix format failed for file: [FILE].exs

** (SyntaxError) [FILE].exs:30: "(" is missing terminator ")". unexpected token: "end" at line 44
    (elixir) lib/code.ex:443: Code.format_string!/2
    (mix) lib/mix/tasks/format.ex:281: Mix.Tasks.Format.format_file/3
    (elixir) lib/task/supervised.ex:88: Task.Supervised.do_apply/2
    (elixir) lib/task/supervised.ex:38: Task.Supervised.reply/5
    (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3

I'd love to se that missing terminator error printed in vim!

That should only happen because Vim redrawed the screen which makes all earlier lines disappear.
:messages should show everything!

Okay.. now we echo the error twice. First using :echomsg, which also logs to the message history, and using :echo, which doesn't log to the message history and overwrites the output of :echomsg..
This sounds weird, but does what we want.. we get the full error right away on :MixFormat and can still look it up later with :messages.
Thanks for bringing this up! :+1:

I do use neovim (I should have been specific, sorry) so it sounds like I have a way to get what I want:
:MixFormat then :messages then G to scroll to bottom.
Something less manual would be amazing, but I understand if this isn't exactly an urgent feature.
Thanks for the work on this, loving it so far!  Especially since I'm still learning syntax/style of elixir.

I do use neovim (I should have been specific, sorry)

I know! You said that in the first post. :-)
Did you update the plugin? The latest version should show the whole error on Neovim right away (without using :messages).

(🤦♂   Should have re-read my own post/head more faith in my issue reporting)
Just updated, and very stoked.  Thank you!

Quick update:
As mentioned above, echoing is handled differently in Vim and Neovim and that won't change in the future. Thus I decided to change the way errors are displayed.
Now a new window is opened instead, which works the same for Vim and Neovim.


List of Advisor categories is missing one

The list of Advisors categories under What is Azure Advisor is missing Operation Excellence and a description of it.

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: ecae7814-3a8b-1401-34b7-a3f53d22b9e5
Version Independent ID: 30254acc-2901-0565-e7dc-619c279f8b78
Content: Introduction to Azure Advisor
Content Source: articles/advisor/advisor-overview.md
Service: advisor
GitHub Login: @kasparks
Microsoft Alias: kasparks

Thanks for your comment. The feedback has been shared with the content owner for further review. Thanks for your patience.

We appreciate your question. Sorry didn't fully answer in a timely manner. Since this question was created some time ago, we don't know if it still applies. We kindly ask you to create a new github issue if it's still important. We will engage with you on the new thread. Thank you for your understanding.
#please-close

#assign:rboucher

#please-close


✨ Adds query placeholder and autoFocus (#267 #268)

Category

Feature

Overview

This PR adds support for a query placeholder (%s can be used as a placeholder for the query (e.g. https://search.com?q=%s&lang=en)), and adds autoFocus to the search bar on page load

Issue Number (if applicable)

Resolves #267
Resolves #268

Why change the readme ?

I believe your branch was not up to date with dev. You are reverting a lot of changes in the files you changed.

Why change the readme ?

I'm not?

I believe your branch was not up to date with dev. You are reverting a lot of changes in the files you changed.

No??

I changed 4 lines lol


when labels is set to All no outcome is printed, only test name

I tracked this down to the XML from the event doesn't include any messages.
In order to solve this for me I changed the  TestExecutionListener.OnTestCase to:
        void OnTestCase(XElement xml)
        {
            var testResult = ParseTestResult(xml);

            string output = null;

            if (testResult.Messages.Count > 0)
                output = testResult.Messages[0];
            else if (testResult.Outcome != TestOutcome.None)
                output = testResult.Outcome.ToString();

            TestFinished?.Invoke(this, new TestEventArgs(testResult.Test.FullyQualifiedName, output));

            if (Options.DesignTime)
                _sink?.SendTestResult(testResult);
        }

I can make a pull request if you want

Fixed by #56

@somdoron would you mind going into NuGet and renaming your dotnet-test-nunit with labels package and add a DEPRECATED into the title so that it is clear to users that it is fixed in the latest official version? Thanks...

@rprouse forgot to update, done :-)

Thanks


How to add a fallback http virtual host

Title: How to add a fallback http virtual host
Description:
I'm writing a listener that is a dynamic forward proxy (using the envoy.filters.http.dynamic_forward_proxy http filter) that will distribute requests based on the target domain name to two different clusters.
The basic requirement is that I want to dispatch requests sent to *.examples.com to cluster1 and then dispatch the remaining (other domains) requests to cluster2.
So I wrote something like this:
static_resources:

  listeners:
  - name: ingress0
    address:
      socket_address:
        address: <IP_ADDRESS>
        port_value: 41000
    filter_chains:
    - filters:
      - name: envoy.filters.network.http_connection_manager
        typed_config:
          "@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
          stat_prefix: ingress_http
          http_protocol_options:
            accept_http_10: true
          route_config:
            name: local_route
            virtual_hosts:
            - name: local_service
              domains:
              - "*.examples.com"
              routes:
              - match:
                  connect_matcher:
                    {}
                route:
                  cluster: cluster1
                  upgrade_configs:
                  - upgrade_type: CONNECT
                    connect_config:
                      {}
              - match:
                  prefix: "/"
                route:
                  cluster: cluster1
            - name: direct # Fallback route
              domains:
                - "*"
              routes:
              - match:
                  connect_matcher:
                    {}
                route:
                  cluster: cluster2
                  upgrade_configs:
                  - upgrade_type: CONNECT
                    connect_config:
                      {}
              - match:
                  prefix: "/"
                route:
                  cluster: cluster2
          http_filters:
          - name: envoy.filters.http.router
            typed_config:
              "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
              suppress_envoy_headers: true
          upgrade_configs:
          - upgrade_type: CONNECT

However it complains:
Only a single wildcard domain is permitted in route local_route

I have searched for info on this but no one asked how to set up a fallback virtual host. Does anyone have any suggestions for this?

This error happens if you have multiple virtual hosts with the * domain. Please post full config that produces this error.

Thanks for the clarification. I checked again and realized that I added two virtual hosts with "*" domain, which is an mistake. I will close this issue.


Bundle httpfs by default

This would be really useful for us, as we use duckdb behind a corporate proxy. There's only proxied internet access. Once we have httpfs installed, installing other plugins is easy by setting the default repo url. Is there any particular reason this was explicitly not bundled?
Also seems to be an issue: https://github.com/duckdb/duckdb-node/issues/29

Hi! Thanks for the contribution, but I am not sure this makes particularly sense to bake httpfs in.
If the request is only around fetching extension, would it not make more sense to have a node-specific functionality to fetch a given extension from the https endpoint via node fetch ?
I need to think how to structure this at the duckdb general level, but it would make sense, to customize to INSTALL extension_name; so that it becomes an invocation of a client specific callback (say fetch in node, or urllib.request in Python, or equivalent in other clients) + INSTALL of a local file.
This also offers a workaround of sort:

build URL like https://extensions.duckdb.org/$version/$platform/httpfs.duckdb_extension.gz
perform fetch on the extension, await that
copy that to a local folder like path/to/https.duckdb_extension.gz
in duckdb, perform: INSTALL 'path/to/https.duckdb_extension.gz'
in duckdb, do LOAD httpfs

Thanks for the comment.
Yeah, the above implementation would work in duckdb to call back into node world to actually do the extension fetching. However, it seems a bit unnecessary, when we have the httpfs plugin which handles everything for us already (e.g. trusting system certs).
Is there any particular reason httpfs was removed? Or any reason why it can't / shouldn't be re-added?
Currently, this is the workaround we're taking however this relies on knowing up-front the duckdb version / platform:

manually download the httpfs extension to a folder lets call /custom-duckdb/extensions
install httpfs from '/custom-duckdb/extensions
install delta from 'https://corporate/proxy/duckdb/extensions/' <- this step now works as httpfs is installed

Is there any particular reason httpfs was removed? Or any reason why it can't / shouldn't be re-added?
Reason is that extensions are meant so that's possible to upgrade / improve them.
If they were to be backed in it would impossible in the current setup to do so.

Also I don't see why node should behave differently than other extensions here.
Possible viable improvements that I can see as doable:

have a functions (SQL side) to return the URL of a given extensions (backing in right platform and version)
have a callback (duckdb-side), to be implemented in relevant clients, to allow using native capabilities to fetch extension and then install it (say something like INSTALL httpfs FROM core (MODE custom) that should build the URL (using step 1), ask node to fetch the extension (using node capabilities)
have an additional npm package wrapper that installs both duckdb, the relevant httpfs extension AND sets the custom repository to be https://extensions.duckdb.org, so that INSTALL x will work out of the box via httpfs.

I think 1 might make sense to have in any case, 2 requires some more toughs, 3 can be likely consider already user-side / contributions are welcome.

Reason is that extensions are meant so that's possible to upgrade / improve them.
I agree with this in a general sense, however I'm not sure how much change we can expect from such an integral extension as httpfs? parquet gets bundled by default, so does json.

I might have a look at 3.) we do recompile duckdb so if there was a way to conditionally include httpfs based on env variables maybe that's a non-intruse option to add support for this?

I think having an option to include httpfs at build time is nice to have, I can have a look at that, even just via the vendor.py passing a off by default option it could work.

I added some logic to optionally compile httpfs. By default it doesn't do anything, however exporting DUCKDB_INCLUDE_HTTPFS=true will make it include all the files required to build httpfs plugin.
It's configurable so any extension can be added which is supported by duckdb out of the box.
Unsure on how the release process works I added all the vendored files in there as well?


Support SNI during TLS handshake

Is your feature improvement request related to a problem? Please describe.

Support SNI (Server Name Indication) resolution when connecting to servers which are hosting multiple SSL certificates. For example the Cumulocity custom domain name feature uses this to allow customers to use their own domain name whilst still hosting Cumulocity on the public cloud instance.
Currently during tedge connect c8y, connecting to a domain which has multiple certificates causes the following error:
ERROR: Custom { kind: InvalidData, error: InvalidCertificateData("invalid peer certificate: CertNotValidForName") }

The difference in certificates can be shown by using openssl without the -servername option.
# with SNI resolution
openssl s_client -showcerts -servername development.exampleiot.com -connect development.exampleiot.com:443 </dev/null

# without SNI resolution
openssl s_client -showcerts -connect development.exampleiot.com:443 </dev/null

Describe the solution you'd like

The SNI resolution should be enabled by default, and there should be no configuration required by the user.
Describe alternatives you've considered

Additional context

References:

https://stackoverflow.com/questions/7885785/using-openssl-to-get-the-certificate-from-a-server

Using a custom domain is a feature of Enterprise Cumulocity Tenants. Information about the custom domain name can be found here:

https://cumulocity.com/guides/users-guide/enterprise-tenant/#domain-name

There some notes about enabling SNI in rustls here (though the instructions are using a much older version):

https://stephanheijl.com/rustls_sni.html

Nevermind, it was something far simpler. Server TLS configuration on port 8883 was to blame. Try the following:
openssl s_client -showcerts -servername development.exampleiot.com -connect development.exampleiot.com:8883 </dev/null

Server correctly responds with cert for CN specified in SNI on port 443, but on port 8883 which thin-edge uses, it responds with *.us.cumulocity.com certificate.