Translate /docs/tutorials/configuration/configure-redis-using-configmap/ in Japanese

This is a Feature Request

What would you like to be added

Translate /docs/tutorials/configuration/configure-redis-using-configmap/ in Japanese.
Why is this needed
No /docs/tutorials/configuration/configure-redis-using-configmap/ in Japanese.
Comments

Copy from en content and Update /content/en/docs/tutorials/configuration/configure-redis-using-configmap/.

/language ja

@cstoku I'll start working on it on 1.15 branch

/assign

/milestone 1.15-ja.1

/close


type mismatch

const handler = startServerAndCreateNextHandler(server, { context: async req => ({ req }) });
In typescript:
 --> ApolloServer is not assignable to type ApolloServer
Another thing is,
return handler required two parameters

I can't seem to replicate. Could you share your code, or even better, a reproduction?

Here is the code

And,

Thank you! The error happens because you're setting request's type to any when it should be either NextRequest or Request.

I tried both of them, but it didn't work either.

It looks like your context function returns a NextRequest type. You need to tell ApolloServer what the shape of your context value is by passing the type parameter to it:
new ApolloServer<NextRequest>({ ... })

I just had the same error and I fixed it by duplicating the context type definition of my server as follows:
                                   // v-- previously always been there
const apolloServer = new ApolloServer<GraphQLContext>({
  // ...
});

                                                          // v-- has to be added explicitly now
const handler = startServerAndCreateNextHandler<NextRequest, GraphQLContext>(apolloServer, {
  context: createGraphQLContext
});

Hope this helps in some way.

Thank you! I've managed to reproduce it.
With API Routes it seems you don't need to pass the context type to the handler, but if you're using context with Route Handlers you'll need to specify both the request type and the context type.
Since we're using the same handler for both API Routes and Route Handlers I don't think we can make it so you don't need to pass the context type, but what we can do is add a note to the README explaining it's necessary.


Timeout formatting volume

Is there any way to increase the timeout?  Looks like mkfs.ext4 is taking more than 5 minutes to format a 1000Gb ebs volume.
Mixlib::ShellOut::CommandTimeout
--------------------------------
Command timed out after 600s:
Command exceeded allowed execution time, process terminated
---- Begin output of yes | mkfs -t ext4  /dev/mapper/graphite-data ----
STDOUT: Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
65536000 inodes, 262142976 blocks
13107148 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
8000 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000, 214990848
Writing inode tables: 6751/8000
STDERR: mke2fs 1.41.12 (17-May-2010)
---- End output of yes | mkfs -t ext4  /dev/mapper/graphite-data ----
Ran yes | mkfs -t ext4  /dev/mapper/graphite-data returned

Cookbook Trace:
---------------
/var/chef/cache/cookbooks/lvm/libraries/provider_lvm_logical_volume.rb:99:in `action_create'

Resource Declaration:
---------------------
# In /var/chef/cache/cookbooks/rse_graphite/recipes/ebs.rb

 45:   lvm_logical_volume 'data' do
 46:     name  'data'
 47:     group 'graphite'
 48:     size        '100%VG'
 49:     filesystem  'ext4'
 50:     mount_point(location: mount_point, options: 'noatime,nodiratime')
 51:   end
 52:

    # If file system is specified, format the logical volume
    if fs_type.nil?
      Chef::Log.info 'File system type is not set. Not formatting...'
    elsif device_formatted?(device_name, fs_type)
      Chef::Log.info "Volume '#{device_name}' is already formatted. Not formatting..."
    else
      shell_out!("yes | mkfs -t #{fs_type} #{fs_params} #{device_name}")
      updates << true
    end

Hi kurtharriger
Mixlib::Shellout accepts a time out argument so there is a way.  Depending on what you need, a temporary solution,  a permanent solution, widespread fix or not you might try one of these.

Add a timeout option to the lvm resource and provider.

See https://github.com/chef/mixlib-shellout/blob/master/lib/mixlib/shellout.rb and monkey patch the timeout value.

I didn't see anything built in to the current lvm code designed to do what you want.
Regards,
Mark

The workaround I came up with was to explicitly format the volume with an execute statement.  lvm_logical_volume will detect that it has already been formatted and just configure fstab and mount point.
execute 'format' do
command 'yes | mkfs -t ext4 /dev/mapper/graphite-data'
not_if 'blkid -o value -s TYPE /dev/mapper/graphite-data'
timeout 1200
end

scratch that executing format explicitly only worked since the device already existed from failed run.  Running on new machine failed since device had not yet been created.

I'd like to request a :timeout parameter added to certain things.  In particular, the default timeout was not enough to allow mkfs.ext4 on a 15TB lv.


add correction for sessions

Current dependencies on/for this PR:

main

PR #2   👈

PR #3

This stack of pull requests is managed by Graphite.


GraphQL refactored and refined

Added graphql support and removed some database bugs too , there are now nested graphql root queries with filters at each level , more filters and root queries can be added if required
thanks

@Gupta-Anubhav12 Did you install and run the pre-commit hooks before pushing?
Please see the contributing guide for reference.

Getting an error when seeding the database on application start for data/commentaries.py:
json.decoder.JSONDecodeError: Unterminated string starting at: line 11985 column 24 (char 1169686)
Is anyone else getting the same?

~Getting an error when seeding the database on application start for data/commentaries.py:~
~json.decoder.JSONDecodeError: Unterminated string starting at: line 11985 column 24 (char 1169686)~
~Is anyone else getting the same?~
Actually, tried again and I no longer get that error but there's a new error:

The verses table doesn't have a field called verse_id that is being referenced in ./bhagavad_gita_api/data/insert/commentaries.py. Please change it to id or verse_number whichever one is relavant.
@Gupta-Anubhav12 @sanujsood

It's working fine for me using in memory sqlite, probably there is some issue in  your database

@sanujsood Did you try after rebasing with main?
gita_verses table doesn't have a column called verse_id. It was removed in a previous commit.

@sanujsood Did you try after rebasing with main?
gita_verses table doesn't have a column called verse_id. It was removed in a previous commit.

verse_id was never a part of Verse schema , the error states that the verse_id from commentaries schema (where it exist) is not found in verse table means there is no verse.id =1 in verse table to link a commentary tuple that has verse_id as 1 ,
so this marks inconsistency in data not the code
attaching below the original schema that we developed before refactoring or any commits (the detta version)

Hope this drops the misinterpretation about the error , @sanujsood  searched the and corrected about right interpretation , I was just to change the code replacing the verse_id in confused state
so the original meaning of the error comes out to be

The database is unable to link a commentary tuple which has verse_id = 1 to a verse which has id = 1 , so this means there is inconsistent data in existing database probably
see this is the verse_id that's being talked of and it is a foriegn key to verse table's primary key that's the verse.id

So we kinda figured out the issue ,
as suggested by @aahnik we got the json dump from a readymade database and that already had data and sqlite is not ACID compliant fully but postgress is , and we are adding commentaries before verses in database using script
so the commentaries are not able to find verses to make a foriegn key for linking
that's where it works at our end (sqlite) and fails at your end (postgress)
Let me commit again by making this change in order

Yes, that makes sense.
My bad that I somehow misinterpreted the error.
From the points you mentioned above, yes inserting the commentaries before the verses would cause that error due to the verses table being empty.
Please fix it at your convenience.
Additionally, please remove the reference scripts if we don't need them.

updated the insertion order and tried running with postgres , it worked fine.

@sanujsood There wasn't any change in order in this commit #86ce5cbc15d4a529c231c280fa8f5de5010ccd92.
Still getting the same error since commentaries are being inserted before verses.

Closing this one. Please see #26.


Update courses.md

This Course is really detailed and is really nice for learning react

Hello @sleez007!
Unfortunately, the courses page in the community section is no longer included in the latest of docs, so let me close this PR as outdated.
Please address other open issues if you would still like to contribute, thank you!


Improved 'check31'

Get the Metric Name using Log Group and Filter names and check the alarms associated with that metric.

Thanks @subramani95


Update Code of Conduct Contact Info

The web duplicate of https://github.com/Say-Their-Name/ios/pull/1#issue-425656589
Will duplicate any decisions from the ios PR to here

Updated to Frank for the time being https://github.com/Say-Their-Name/ios/pull/1#pullrequestreview-421521250


semantic_search() got an unexpected keyword argument 'forbidden_toks'

When running run_search_prompt.py, there occurs a issue and the error message is as follows:
File "/home/xx/project/KnowledgeBoundary/knowledge-boundary/run_search_prompt.py", line 136, in <module>
    run_knowledge(args)
  File "/home/xx/project/KnowledgeBoundary/knowledge-boundary/run_search_prompt.py", line 108, in run_knowledge
    success, prompt, answer, ori_q, ori_a, iter_round = run_knowledge_iter(args, qs, ans, model, tokenizer, embedding_table)
  File "/home/xx/project/KnowledgeBoundary/knowledge-boundary/run_search_prompt.py", line 82, in run_knowledge_iter
    new_embedding, tokenized_prompt = nn_project(input_embedding, model.get_input_embeddings(), forbidden_toks, args.ceil, args.device)
  File "/home/xx/project/KnowledgeBoundary/knowledge-boundary/utils.py", line 182, in nn_project
    hits = semantic_search(curr_embeds, embedding_matrix,
TypeError: semantic_search() got an unexpected keyword argument 'forbidden_toks'

I checked the document of Sentence_transformer, and the params of semantic_search() are as follows:

So please is there any way to fix this?

How about deleting the embedding corresponding to the forvidden_toks directly from the embedding_matrix?

When running run_search_prompt.py, there occurs a issue and the error message is as follows:
File "/home/xx/project/KnowledgeBoundary/knowledge-boundary/run_search_prompt.py", line 136, in <module>
    run_knowledge(args)
  File "/home/xx/project/KnowledgeBoundary/knowledge-boundary/run_search_prompt.py", line 108, in run_knowledge
    success, prompt, answer, ori_q, ori_a, iter_round = run_knowledge_iter(args, qs, ans, model, tokenizer, embedding_table)
  File "/home/xx/project/KnowledgeBoundary/knowledge-boundary/run_search_prompt.py", line 82, in run_knowledge_iter
    new_embedding, tokenized_prompt = nn_project(input_embedding, model.get_input_embeddings(), forbidden_toks, args.ceil, args.device)
  File "/home/xx/project/KnowledgeBoundary/knowledge-boundary/utils.py", line 182, in nn_project
    hits = semantic_search(curr_embeds, embedding_matrix,
TypeError: semantic_search() got an unexpected keyword argument 'forbidden_toks'

I checked the document of Sentence_transformer, and the params of semantic_search() are as follows:  So please is there any way to fix this?

Thanks for your interest! We are sorry that actually we have changed the original function semantic_search in the library to add the parameter forbidden_toks . The modified library function is shown below. This change will not affect the normal use of this function. We implement in this way mainly to make it convenient for our debugging. You can also try deleting the embedding directly from the embedding_matrix.
def semantic_search(
    query_embeddings: Tensor,
    corpus_embeddings: Tensor,
    forbidden_toks: Tensor = None,
    query_chunk_size: int = 100,
    corpus_chunk_size: int = 500000,
    top_k: int = 10,
    score_function: Callable[[Tensor, Tensor], Tensor] = cos_sim,
) -> List[List[Dict[str, Union[int, float]]]]:
    """
    This function performs a cosine similarity search between a list of query embeddings  and a list of corpus embeddings.
    It can be used for Information Retrieval / Semantic Search for corpora up to about 1 Million entries.

    :param query_embeddings: A 2 dimensional tensor with the query embeddings.
    :param corpus_embeddings: A 2 dimensional tensor with the corpus embeddings.
    :param query_chunk_size: Process 100 queries simultaneously. Increasing that value increases the speed, but requires more memory.
    :param corpus_chunk_size: Scans the corpus 100k entries at a time. Increasing that value increases the speed, but requires more memory.
    :param top_k: Retrieve top k matching entries.
    :param score_function: Function for computing scores. By default, cosine similarity.
    :return: Returns a list with one entry for each query. Each entry is a list of dictionaries with the keys 'corpus_id' and 'score', sorted by decreasing cosine similarity scores.
    """

    if isinstance(query_embeddings, (np.ndarray, np.generic)):
        query_embeddings = torch.from_numpy(query_embeddings)
    elif isinstance(query_embeddings, list):
        query_embeddings = torch.stack(query_embeddings)

    if len(query_embeddings.shape) == 1:
        query_embeddings = query_embeddings.unsqueeze(0)

    if isinstance(corpus_embeddings, (np.ndarray, np.generic)):
        corpus_embeddings = torch.from_numpy(corpus_embeddings)
    elif isinstance(corpus_embeddings, list):
        corpus_embeddings = torch.stack(corpus_embeddings)

    # Check that corpus and queries are on the same device
    if corpus_embeddings.device != query_embeddings.device:
        query_embeddings = query_embeddings.to(corpus_embeddings.device)

    queries_result_list = [[] for _ in range(len(query_embeddings))]

    for query_start_idx in range(0, len(query_embeddings), query_chunk_size):
        # Iterate over chunks of the corpus
        for corpus_start_idx in range(0, len(corpus_embeddings), corpus_chunk_size):
            # Compute cosine similarities
            cos_scores = score_function(
                query_embeddings[query_start_idx : query_start_idx + query_chunk_size],
                corpus_embeddings[corpus_start_idx : corpus_start_idx + corpus_chunk_size],
            )
            if forbidden_toks is not None:
                cos_scores[:, forbidden_toks] = -float("inf")
            # Get top-k scores
            cos_scores_top_k_values, cos_scores_top_k_idx = torch.topk(
                cos_scores, min(top_k, len(cos_scores[0])), dim=1, largest=True, sorted=False
            )
            cos_scores_top_k_values = cos_scores_top_k_values.cpu().tolist()
            cos_scores_top_k_idx = cos_scores_top_k_idx.cpu().tolist()

            for query_itr in range(len(cos_scores)):
                for sub_corpus_id, score in zip(cos_scores_top_k_idx[query_itr], cos_scores_top_k_values[query_itr]):
                    corpus_id = corpus_start_idx + sub_corpus_id
                    query_id = query_start_idx + query_itr
                    if len(queries_result_list[query_id]) < top_k:
                        heapq.heappush(
                            queries_result_list[query_id], (score, corpus_id)
                        )  # heaqp tracks the quantity of the first element in the tuple
                    else:
                        heapq.heappushpop(queries_result_list[query_id], (score, corpus_id))

    # change the data format and sort
    for query_id in range(len(queries_result_list)):
        for doc_itr in range(len(queries_result_list[query_id])):
            score, corpus_id = queries_result_list[query_id][doc_itr]
            queries_result_list[query_id][doc_itr] = {"corpus_id": corpus_id, "score": score}
        queries_result_list[query_id] = sorted(queries_result_list[query_id], key=lambda x: x["score"], reverse=True)

    return queries_result_list


Timer in chess activity stops on inactive tabs

The timer or clock in chess activity stops inactive tabs.
steps:

enable clock in activity
switch tab or minimize it.
open after some time.

Nice shot. A perfect feature for cheaters :smile:

Fixed in https://github.com/llaske/sugarizer/pull/829


docs(platform): organize, clean up, and expand docs

[x] Organize docs
[x] Change docs URLs to more conventional lowercase
[x] Fix issues from copying documentation; closes #3587

[x] Remove extra spaces before punctuation
[x] Add dropped hyperlinks -- often indicated by multiple consecutive spaces
[x] Make capitalization of titles and section headings consistent
[x] Fix broken links

[x] Correct capitalization of BioSimulations
[ ] Add FAQs

:tada: This PR is included in version 6.1.0 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:


Notification improvements

What does this PR?
Adds three button in the list to see All, Unread, Read notifications. Click on that button shows the corresponding notifications.
Increase the size of  "Mark as read" button.
Clicks on the select button allows you to select notifications and also show the three dot menu. hover on three dot menu shows the dropdown of "Mark as read".
Click on "Mark as read" allow you to mark the notifications in a bulk way.
Steps to reproduce

Click on the notifications icon and you will see the three buttons to see the corresponding notifications.
By clicking on select button will allow you to select the notifications.
By clicking on dropdown button is responsible to mark all the selected notifications.

Issue number
fixes #1060
Screenshot / Video
https://user-images.githubusercontent.com/106739598/227907202-b0e56048-27ae-4fa8-935e-b0ded394b3f1.mp4

Hi @feruzm
I have resolved conflicts with development. This PR is also ready for review.

@dkildar and @feruzm
This PR is also updated after resolving all  the comments.

@MTSaeed Thanks looking good so far, few changes needed:

There is svg file conflict that needs fixing.
Can you remove Select button and add ✅  just before All button so when it is checked it will allow you to select notifications. That way we will have much better looking selection.

All other changes seem good from UI perspective, after fixes, will do final code review.

@feruzm  According to your suggestion,  the UI looks like:
https://user-images.githubusercontent.com/106739598/232456808-210e98a6-3284-4a46-9e0d-eff595a9b3ba.mp4

@MTSaeed Looks better but now mark as read icon and selection checkmarks are same. Can we use ✅  checkmark with square icon for selection?

https://user-images.githubusercontent.com/106739598/232478601-bc026154-4fa5-4eaa-be8e-9815a77cfc0b.mp4

@MTSaeed One more, last change.
Can we change mark as read icon to this, which we use on mobile app, that way, we can show this direct after ✅  button without showing 3 dots options and also on top of notifications panel as well which marks all notifications as marked?

https://user-images.githubusercontent.com/106739598/232722265-b1110b1e-caaf-4db3-b0c2-252665961aec.mp4

@MTSaeed https://www.loom.com/share/33c63359550241109f72fa5a67c8c7b9

@MTSaeed https://www.loom.com/share/33c63359550241109f72fa5a67c8c7b9

@feruzm Thanks for the clarification.

https://user-images.githubusercontent.com/106739598/232750230-0e6b9ae9-c475-4d74-9eb9-b227216f27cb.mp4


Fix: cannot have multiple apps using the library at the same time on the same device

It seems our services are public, which is weird. Probably simply a namespace issue (all our apps have the same vendor name or such?)

At the moment there is no clear explanation why the exported=false attribute in service declarations is not enough to stop them from being used by other apps using the same library.
I suspect discovering services with queryIntentServices() simply lists all matching services regardless of whether or not they are exported (thus whether or not they can be created/used by implicit intent). Services are then bound by explicit intent, which bypasses the exported attribute that seems to only affect use by implicit intents. And since sdk services have the same name and package name for all apps they may conflict there. For that reason, skipping services with a different UID during discovery does not affect the app's behavior or fix any observed issue, and I have not found another way to avoid using unwanted services.
I have also not observed any crash or severe bug rendering the application unusable when two of them are on at the same time. The scanner sometimes does not work properly immediately when switching to the app from another scanner app, but simply exiting and restarting the view seems to make it work again.
Issue will likely be fixed while addressing #44 and #45 (#25) and might require moving away from provider services.


Analyze only Python Files

Currently, in some python packages, PyCG tried to analyze submodule files which are shared library files (having .so file extension). A a result, the tool would yield a UnicodeDecodeError as it would not be able to decode those files, as also reported here: https://github.com/vitsalis/PyCG/issues/29
With this PR, we enable PyCG to analyze only submodule python files.
An example to reproduce the error and to test the fix that this PR introduces:
pip3 download cryptography==3.4.7 --no-deps
unzip cryptography-3.4.7-cp36-abi3-manylinux2014_x86_64.whl
python3 -m pycg --fasten  --package cryptography $(find cryptography -type f -name "*.py")   -o  package.json

Nice, thanks for the update! Merging.


Visual break between file finder and editor

Something I've noticed whilst using the UI and Syntax for the last few days in that there is no clear divide between the File Finder and the main editor. The two just blend together.
Just wondering if there would be some value in adding a subtle dividing line between the two? This should make it easier when it comes to resizing the file finder.
Editor

There is a very subtle dividing line within the settings panel currently, its only subtle but it really helps divide the settings tabs and the content of each tab.
Settings

I love this UI and Syntax by the way, thanks for putting the time in to make this.

This has been resolved in the 0.4.6 release. You will find an option in the theme's settings to enhance contrast between panels and the text editor.


Exploration of Link components (Link, Pagination, Navlinks) and how to use them with the router

📇 User story
As a developer that uses Angular, I want to ensure that GCDS components work with Angular, so that I am confident that the product will work for my project.
As a GCDS developer, I want to test out how to use GCDS navigational components such as Link, Pagination, Navlinks with frameworks (Angular in this instance) that use a router for navigating within the application
✅ Definition of Done

[ ] Tested our navigational components with the router in Angular
[ ] A document that highlights the recommended solutions to use our navigational components with a router
[ ] Engagement follow up

📜 Acceptance criteria

[ ] GCDS Components Angular package work in Angular
[ ] A recommendation for Angular developers on how to use GCDS Components with the router

@daine, hello, I was wondering if there was any sort of timeline for this issue to be picked up? i.e., 4 weeks? 8 weeks? etc.? Thank you

@dfoAbdul we work in sprints, so we'd love to have more info so we can arrange to get this prioritized. Tagging our other team members here @adorayi @brockhigg10

@daine, depending on how fast this is prioritized we can use the Angular components for our upcoming project. However, if it takes slightly longer, we have another small project we can use it in ~2 months. We are keen for functional Angular support for GC design system in general.  Thank you!

@daine @ethanWallace @melaniebmn would it make sense to look into this when we are building the Angular starter app?


use PkgMgmt 1.3.2 which has fix for NetCore30

PR Summary

PR Context

PR Checklist

[ ] PR has a meaningful title

Use the present tense and imperative mood when describing your changes

[ ] Summarized changes
[ ] Change is not breaking
[ ] Make sure all .h, .cpp, .cs, .ps1 and .psm1 files have the correct copyright header
[ ] This PR is ready to merge and is not Work in Progress.

If the PR is work in progress, please add the prefix WIP: or [ WIP ] to the beginning of the title (the WIP bot will keep its status check at Pending while the prefix is present) and remove the prefix when the PR is ready.

User-facing changes

[ ] Not Applicable
OR
[ ] Documentation needed

[ ] Issue filed:

Testing - New and feature

[ ] N/A or can only be tested interactively
OR
[ ] Make sure you've added a new test if existing tests do not effectively test the code changed

@PoshChan please get failures

Opened issue against pkgmgmt for macOS failures: https://github.com/OneGet/oneget/issues/450

Waiting to see result of PkgMgmt failure on macOS

@PoshChan please get failures

@SteveL-MSFT, test results were not published for PowerShell-CI-linux at vstfs:///Build/Build/22549

@SteveL-MSFT, your last commit had 2 failures in PowerShell-CI-macos
PowerShellGet - Module tests (Admin).Should install a module correctly to the required location with AllUsers scope
Expected a value, but got $null or empty.
at <ScriptBlock>, /Users/vsts/agent/2.150.3/work/1/s/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1: line 165
165:         $installedModuleInfo | Should -Not -BeNullOrEmpty

PowerShellGet - Module tests.Should install a module correctly to the required location with default CurrentUser scope
Expected a value, but got $null or empty.
at <ScriptBlock>, /Users/vsts/agent/2.150.3/work/1/s/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1: line 134
134:         $installedModuleInfo | Should -Not -BeNullOrEmpty

@SteveL-MSFT, test results were not published for PowerShell-CI-static-analysis at vstfs:///Build/Build/22547

@SteveL-MSFT, test results were not published for PowerShell-CI-windows at vstfs:///Build/Build/22550


Spurious disconnect when Homie connects over TLS/SSL

As first reported in #44 I'm seeing a disconnect when Homie connects via TLS (this does not occur in plain connections). Screenshot:

Server-side, the MQTT broker identifies an SSL handshake error, even after it sees the initial publishes from the device:
1458722417: OpenSSL Error: error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure
1458722417: Socket error on client Homie-cf3a07e0, disconnecting.

It would appear to me there's something corrupt going over the wire.
After the second connection succeeds, the Homie device carries on happily publishing for hours on end. This behaviour is reproducible.

The following sketch is basically a copy of your LightOnOff example. You will notice that I added a second node called ping which doesn't do terribly much.
#include <Homie.h>

const int PIN_RELAY = 16;

HomieNode lightNode("light", "switch");
HomieNode pingNode("ping", "pong");

bool lightOnHandler(String message) {
  if (message == "true") {
    digitalWrite(PIN_RELAY, HIGH);
    Homie.setNodeProperty(lightNode, "on", "true"); // Update the state of the light
    Serial.println("Light is on");
  } else if (message == "false") {
    digitalWrite(PIN_RELAY, LOW);
    Homie.setNodeProperty(lightNode, "on", "false");
    Serial.println("Light is off");
  } else {
    return false;
  }

  return true;
}

bool pingHandler(String message) {
  Serial.println("ping here");
  Homie.setNodeProperty(pingNode, "pong", "Bonjour!");
  return true;
}

void setup() {
  pinMode(PIN_RELAY, OUTPUT);
  digitalWrite(PIN_RELAY, LOW);

  Homie.setFirmware("sub2-relay", "1.0.0");
  lightNode.subscribe("on", lightOnHandler);
  pingNode.subscribe("on", pingHandler);
  Homie.registerNode(lightNode);
  Homie.registerNode(pingNode);
  Homie.setup();
}

void loop() {
  Homie.loop();
}

When run over a plain MQTT connection it works. When running over an TLS connection the device disconnects and reconnects randomly and seemingly doesn't react at all (neither to light nor to ping).
I'm hoping this can help you diagnose the issue.

The issue happening obviously because of the heap, I'll try to remove most of the dynamic allocations and instead allocate on the stack. The good thing is I am learning a lot resolving this issue!

Could you please try again? It seems stable on my side after 2be5da01fa6537d5fe7db4fae963fc1a470c4f16

I'm sorry to disappoint you, but no change here. In plain mode all works fine as far as I can tell. In TLS mode, the moment I try to talk to the device (e.g. relay on), it disconnects.

So, testing with the above sketch on TLS again, this time a bit more carefully. The screenshot shows what happens initially:

In fact, I don't even have to try and switch "light on"; the device disconnects by itself quite periodically, whereupon the broker logs
1458801612: Sending SUBACK to Homie-cf3a07e0
1458801612: OpenSSL Error: error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure
1458801612: Socket error on client Homie-cf3a07e0, disconnecting.

The first couple minutes of the socket errors seen on the broker in human readable times show this happens about every 5 seconds:
1458801612 Thu Mar 24 07:40:12 2016
1458801617 Thu Mar 24 07:40:17 2016
1458801623 Thu Mar 24 07:40:23 2016
1458801673 Thu Mar 24 07:41:13 2016
1458801703 Thu Mar 24 07:41:43 2016
1458801704 Thu Mar 24 07:41:44 2016
1458801709 Thu Mar 24 07:41:49 2016
1458801714 Thu Mar 24 07:41:54 2016
1458801719 Thu Mar 24 07:41:59 2016

If I comment out the two lines in above sketch:
// pingNode.subscribe("on", pingHandler);
// Homie.registerNode(pingNode);

the device is much more stable: after the initial disconnect it stays up and I can talk to it.

There are still some dynamic allocations done:

The registered nodes
The MQTT topic buffer
The config file buffer
The strings in the config

A solution would be to completely avoid these dynamic allocations, but it would mean setting hard limits in the code:

Limit the max length of a node id / type
Limit the number of subscriptions per node
Limit the number of nodes
Limit the max friendly $name of a device

... etc.
If this does not solve the issue, then the problem is that the framework is oversized for the ESP8266

I think it's a case of memory being cloberred somewhere ...
When you said Limit the max friendly $name of a device, I thought "Hey!", and changed $name from Livingroom bookshelf to N1. What happens now, is
1458815935: New connection from <IP_ADDRESS> on port 9993.

followed by this:

though not readily reproducible.

I've been going backwards in largish steps to commit https://github.com/marvinroger/homie-esp8266/commit/f6ee49ab532a4e30274e52d5c14dfda1d484e11b to see if this has anything to do with me showing up on the scene here. It doesn't. :smile:
All the time we've spoken so far, I was testing with a Wemos-D1 mini. I didn't really expect it would make a difference, but the NodeMCU (Amica) behaves identically: the above sketch just won't behave properly.

To be honest, when I implemented SSL I never tested it. SSL encryption takes up more than a quarter of the available heap, so that does not surprise me.

Does the following information help at all? Of course I realize I'm comparing apples and potatoes; I'm just trying to be helpful...
Screenshot of memory requirements for sub2.ino (the small sketch above):

Screenshot of memory requirements for a simple MQTT over TLS using Imroy/pubsubclient:

And you are helpful! But this piece of information shows stack usage, not heap, which is our problem here. I am working on moving everything to the stack in a clean way. The problem is this will be a breaking change.

Well, in my possibly not very humble opinion, you should go ahead and break it so that it's fixed! :smile:

You're right!

It's not a breaking change, so good news, and the problematic sketch seems to work. Could you please test?

By the way, maybe fingerprint is fixed too?

The good news is, it is much better, the bad news is, it is not good. I have the following observations:

My small test sketch (sub2.ino as shown above) actually works, and I was able to "ping" it.
Fingerprint checking doesn't work: it's actually completely ignored, i.e. wether I use correct or incorrect fingerprint in configuration makes no difference. (I haven't been able to look at your code though)
It's touch and go wether sketches work. I was pleased to see that my slightly larger sketch (4 nodes) worked and I could switch a relay, but then it died. Whether or not the sketch stays alive is a bit of touch and go.

Looking slightly closer, I notice that you've changed the way subscriptions work. Contrary to previously where individual subscribes were issued, I now see a single wild-card subscription:
1459003383: Received SUBSCRIBE from Homie-cf3a07e0
1459003383: 	sensors/homie/cf3a07e0/# (QoS 1)

I think Homie is literally killing itself! My previous experience with PubSubClient on Arduino shows that if I send out a few messages "en block" it just dies. In this particular case, Homie is sending out several publishes, eg. during setupHandler, and they're being bounced back to the device; I think it then just dies.
I will try, time permitting, to observe this a little closer, but I believe that ought to be the reason...
Be that as it may, congrats so far!

What would probably help a bit to mitigate the issue is to narrow-down the wildcard to something like this:
sensors/homie/cf3a07e0/+/+/set

This would prevent most publishes from a Homie device being sent back to the same Homie device. I'm 3/4 or 7/8 convinced the device is hanging itself up due, not to your code, but to PubSubClient.

You're right, the wildcard subscription change is due to an issue with PubSubClient when subscribing to 5 topics or more. Subscribing to only /set messages, /$ota and /$reset would reduce the load. I'll try next week, thanks for the great suggestion!

I've had a Homie device running since my last comment (approx 24h) on TLS, and it's still publishing three messages every 10s:
sensors/homie/cf3a07e0/temperature/degrees 22.50
sensors/homie/cf3a07e0/temperature/freeheap 11504
sensors/homie/cf3a07e0/ping/epoch<PHONE_NUMBER>

I do note, however, that it periodically disconnects and then reconnects. The broker logs
1459150544: OpenSSL Error: error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure
1459150544: Socket error on client Homie-cf3a07e0, disconnecting.

I can't optimize things more than this, if it's still an issue, it has to be solved in PubSubClient or in the Arduino for ESP8266 SSL implementation. :confused:

I have an idea. By default, the ESP runs at 80MHz. I have seen projects running at 160MHz when using SSL. With twice the power of calculation, maybe the handshake failure will disappear, and the touch and go you're describing might disappear... What do you think?

As long as the chip then doesn't burn a hole through my desk, I'd say "let's try it"! ;-)

Could you please try your "heavy" sketch?

 (Ok, those were two words, but you get the drift.)

Homie hasn't been able to kill itself with pubs/subs yet; it survived many resets, which it didn't do previously.
My heavy sketch has been running sans disconnects since 08:16 this morning. (I'll continue to monitor for 24h)
Fingerprint checking works! (I've tested positive and negative.)

You've done a tremendous job, thank you.
I would like to recommend adding something like this to the Wiki:
Fingerprint
Adding a TLS fingerprint effectively pins the device to a particular certificate. Furthermore, as currently implemented by WifiSecureClient(), both mqtt.host and ota.host are verified against the server certificate's common name (CN) in the certificate subject or in the SANs (subjectAlternateName) contained in it, but not in their IP addresses. So, if the certificate used by your server looks like
Subject: CN=tiggr.example.org<EMAIL_ADDRESS>...
X509v3 Subject Alternative Name:
  IP Address:<IP_ADDRESS>, DNS:broker.example.org

enabling fingerprint in Homie will work only if host is set to tiggr.example.org or broker.example.org and the correct fingerprint is used; setting host to the IP address will cause fingerprint verification to fail.

Great! We made it, thanks a lot for your tests, it helped so much. I also added a note on the docs. Note that the Wiki is no more used, because the Wiki was up-to-date with the latest git rev, and so people using an older version were not able to have instructions related to their version. So now docs are embedded into the repo. :wink:

You said you were monitoring for 24h, is it still alright?

I didn't want to bother you with it ... ;-) Yes, it's basically alright. I've had the following reconnects during the past 24h, but much better than it was:
2016-03-29 19:43:47.701872
2016-03-29 21:33:58.774420
2016-03-30 11:43:53.941828

So, I'd say it's fine.

Awesome! Maybe the 2.2.0 release of the Arduino for ESP8266 will fix things even more, but I can't do more in Homie. Can we close?

Fermé! ;-)


Add bolt db package

@wParkhi
Please resolve conflict.

@wParkhi,
Upper conflicts is related with my commits, so I resolved it.

Looks good to me.


FCM Registration Token Generated by pushObject.on('registration') is incorrect or not working

Expected Behaviour
Firebase Cloud Messaging is able to send a message to a specific user via their FCM registration token.
Actual Behaviour
The token generated on registering a device is given. The token is not able to be used to send messages to, as Firebase Cloud Messaging reports a failed status with the notification not appearing on the specific device. Sending a message to all devices using the app works fine.
Steps to Reproduce

Create a new Ionic project.
Install the relevant plugins for the Ionic project.
$ ionic cordova plugin add phonegap-plugin-push $ npm install --save @ionic-native/push
Add the sample code provided by Ionic Native Push Documentation
Compile and Build with the following command
ionic cordova platform rm android && ionic cordova platform add android
Open the project in android studio under the platform folder
Add the relevant google-services.json file under the app folder.
Sync and run the app on an emulator provided by Android Studio (For reference, I used the Nexus 5X API 28)
Using the example code, retrieve the registration token using Chrome's Inspect Devices (chrome://inspect/#devices)
8.5: The retrieved token follows the format "eJAPP91Mq_Q:APA91b...." and is 174 characters long.
Attempt to send a message to this specific device using the registration token in Firebase Cloud Messaging

Platform and Version (eg. Android 5.0 or iOS 9.2.1)
Android 9, API 28
iOS x.x.x (not tested)
(Android) What device vendor (e.g. Samsung, HTC, Sony...)
LG (emulator)
Cordova CLI version and cordova platform version
Cordova 8.0.0
Cordova Platform Version Android 7.0.0
Ionic 3.2.0

Plugin version
phonegap-plugin-push 2.1.3 "PushPlugin"

Sample Code that illustrates the problem
  registerPush() {
    const options: PushOptions = {
      android: {
        senderID: '784836114812'
      },
      ios: {
        alert: 'true',
        badge: true,
        sound: 'false'
      }
    };
    const pushObject: PushObject = this.push.init(options);

    pushObject.on('notification').subscribe((notification: any) =>
    {
      console.log('Received a notification', notification)
    });

    pushObject.on('registration').subscribe((registration: any) => {
      console.log('Device registered', registration)

    });
    pushObject.subscribe('charger');
    pushObject.on('error').subscribe(error => {
      console.error('Error with Push plugin', error)
    });

  }

See status message from FCM.

I think, that push notification doesn't work with virtual device... Try an real device if works.

That was my suspicion, but would there be a reason that using FCM to send a message to all devices would work, but not to a specific devices, both methods on an emulator?

@KingJackFrost I'm going to close this as we don't support the emulator. Push notifications don't necessarily work there. If you can reproduce on a device just ask to re-open.

@macdonst  I did not know that, my apologies. I took ludufre's advice, and I tried the exact steps on a physical samsung phone. Now FCM does send correctly with a completed status, but there does not appear to be a notification on the system tray. Request to re-open.

@KingJackFrost so I'd like to see the push payload you send and the logs when the push arrives, i.e.adb logcat | grep Push.

@macdonst  Sure. Regarding the push payload, I use FCM to send the message. In other words, I use their built-in manual messages. Under "new message", I put some random string for Message Text, I select single device with the appropriate registration token, and I click "send message". For the logs, I used the command you gave me and it gave me this.
07-17 15:38:46.814 19427 19690 I Metrics:BatchTransmitte: QueuePusher.sendBatches - Drained batch queue.; Number of HIGH_ANONYMOUS queue batches sent: 0
07-17 15:38:46.817 19427 19691 I Metrics:BatchTransmitte: QueuePusher.sendBatches - Drained batch queue.; Number of HIGH_NON_ANONYMOUS queue batches sent: 0
07-17 15:39:06.217 22989 25150 D FCMPlugin: ==> FCMPlugin sendPushPayload
07-17 15:41:54.506  2960 18264 D ImsUtil : getSimSlotFromUri: content://com.samsung.rcs.autoconfigurationprovider/root/application/1/services/geolocPushAuth
07-17 15:41:54.716  2960 18264 D ImsUtil : getSimSlotFromUri: content://com.samsung.rcs.autoconfigurationprovider/parameter/geolocPushAuth#simslot0
07-17 15:41:54.742 27045 27076 D CS/RcsOwnCapsManager: queryOwnCaps, Enriched Call is : false mOwnGeoPush : false
07-17 15:43:46.816 19427 19690 I Metrics:BatchTransmitte: QueuePusher.sendBatches - Drained batch queue.; Number of HIGH_ANONYMOUS queue batches sent: 0
07-17 15:43:46.817 19427 19691 I Metrics:BatchTransmitte: QueuePusher.sendBatches - Drained batch queue.; Number of HIGH_NON_ANONYMOUS queue batches sent: 0
07-17 15:44:14.438  5701  5701 E SPPClientService: [[PushClientService]] reqType : 0
07-17 15:44:14.449  5701  5701 E SPPClientService: [[PushClientService]] F:false, D:false, E:false, T:false, S:true, R:false
07-17 15:47:56.552 30793 31069 W fb4a.ServiceInfoParser: X.3wA: Service com.facebook.push.fbpushdata.FbPushDataHandlerService is missing meta key com.facebook.common.jobscheduler.compat.jobIds
07-17 15:55:18.147 22989 25150 D FCMPlugin: ==> FCMPlugin sendPushPayload
07-17 15:56:10.471 22989 25150 D FCMPlugin: ==> FCMPlugin sendPushPayload
07-17 15:59:14.531  5701  5701 E SPPClientService: [[PushClientService]] reqType : 0
07-17 15:59:14.550  5701  5701 E SPPClientService: [[PushClientService]] F:false, D:false, E:false, T:false, S:true, R:false
07-17 15:59:30.814  7414  7563 W msgr.ServiceInfoParser: X.2K8: Service com.facebook.push.fbpushdata.FbPushDataHandlerService is missing meta key com.facebook.common.jobscheduler.compat.jobIds
07-17 15:59:43.935 22989 25150 D FCMPlugin: ==> FCMPlugin sendPushPayload
07-17 16:03:21.459 10239 10239 I PpmtManager: initializePpmt() setPushToken
07-17 16:04:11.169 22989 25150 D FCMPlugin: ==> FCMPlugin sendPushPayload

I also went directly to logcat, sent another message, and got these logs while the message was processed.
7-17 16:10:18.097 22989-15619/com.EVForceApp D/FA: Logging event (FE): notification_receive(_nr), Bundle[{firebase_event_origin(_o)=fcm, message_device_time(_ndt)=0, message_time(_nmt)=1531861819, message_id(_nmid)=1000200903371630131}]
07-17 16:10:18.120 22989-25150/com.EVForceApp W/FirebaseMessaging: Missing Default Notification Channel metadata in AndroidManifest. Default value will be used.
07-17 16:10:18.121 22989-15619/com.EVForceApp V/FA: Connecting to remote service
07-17 16:10:18.125 22989-25150/com.EVForceApp D/Notification: allPendingIntents
07-17 16:10:18.136 22989-15619/com.EVForceApp D/FA: Connected to remote service
07-17 16:10:18.139 22989-15619/com.EVForceApp V/FA: Processing queued up service tasks: 1
07-17 16:10:23.204 22989-15619/com.EVForceApp V/FA: Inactivity, disconnecting from the service

What's even weirder is, as I was typing this message to you, the message I sent suddenly appeared. Perhaps firebase was having issues as it solved itself?

@KingJackFrost if you are using the FCM console then you are running into the Notification vs Data payload issue. As well it looks like you are missing a default channel.

@macdonst Thanks for pointing these links out to me! I was not certain if these issues would occur with the FCM console, but in that case, would I have to find a different way to push the payload? That is how I am understanding the issue.
Regarding the default channel, I did read that you technically would not need to specify it, as then a default channel "PushPluginChannel" would be created. Therefore, would I need to specify such a channel?

@KingJackFrost there are a bunch of sample node scripts in the docs/PAYLOAD.md file that show how to send push notifications in the correct format.
With regards to the default channel the plugin should set it up but I just saw some weirdness in the logs.

@macdonst  Thanks for directing me to the correct place. I will read from there.
Taking your advice, I will implement a "default" channel just to be sure there isn't any weirdness going on.
Closing this current issue, but if I have other questions, I'll make a separate issue. T


pull request for e2e test at 01/20/2017 11:45:10

:white_check_mark: Validation status: passed
For more details, please refer to the build report.
Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.


Newer versions (>18.2.7) are not published to RubyGems

We could notice that the Chef v >18.2.7 are not getting published to the RubyGems. Is this something that’s being rectified?

Hello, @sundarraja, yes, 18.2.7 is the current "stable" version of Chef. This will be updated once we promote Chef 18.3.


Default values for MatParams

The currently seems to be no way to set default values for MatParams through the GUI.
Getting a dialog by clicking the component, or hooking up the Properties window.

One might argue that defines don't belong in shader nodes, which i guess is true for pure shader nodes. I'm however working on a hybrid PBR model ref here which uses them to define textures (like PBRLighting).


block more adult sites

playvids.com
livecam.com
extralunchmoney.com

Ping @sinfonietta!

This looks done.  Closing.


The voting mechanism selects the most consistent of the 20 results

Hello. I saw in your paper that you said "After removing the errors from all the outcomes, we identify the most consistent SQL as the final SQL by applying a voting mechanism to these execution results."

But what I see in your code is the choice of the first valid SQL query out of 20 generated for a natural language problem.

Can you help me explain？

Hi,
In line 200, we call the get_sqls function, which performs the self-consistency method to select the best SQL query from the candidate SQL queries.
You could review the implementation of this function, as it should help you resolve any confusion.

Ok, I see where you said, thank you for your answer.


Include photo in member bios

As a CoT squad member,
I want to share a picture in my bio,
So that I can represent myself in a visual way for networking.

This functionality has been written and merged into pit.

This functionality has been written and merged into pit.


Your n8n server is configured to use a secure cookie, however you are either visiting this via an insecure URL, or using Safari.

I have a local Home Assistant installation without SSL and external access. How can I set the n8n parameter?

Hello,
Please check this link : https://community.home-assistant.io/t/n8n-io-integration/297903/34?u=rbillon59
it should solve your issue


Supporting Multiple Client Connections and Message Processing

Sure! Here's the translation:
"How can multiple client connections and message processing be supported, and when will this be updated and supported? I see that currently only one client connection is supported, so I would like to ask about this.

This is something that would be a great improvement to our system! It's not currently supported but we should work on it soon


Support: useEffect(..) hook

Support a useEffect(..) hook similar in spirit to React's useEffect(..) hook. Potentially rename ours to useDeferred(..) to better reflect what it does.
The asynchronous deferral that should occur will not be as controlled as with React, since they base its execution on the React lifecycle. It could be as simple as setTimeout(..0) / setImmediate(..) / process.nextTick(..), or Promise.resolve().then(..) (microtask), or possibly just requestAnimationFrame(..). Need to figure out which async deferral strategy makes sense, or which combination of them for cross-platform.
It's critical that the deferred effect is given the same hook context as the parent function, so that it can use useState(..), etc.
Similar to React's implementation, useEffect(..) needs to take a list of state variables to determine if the deferred effect should run that time or not. It only runs if the list is missing, or if the list contains different state values than the last time it ran. If the list is empty, it only runs the first time.
For example:
function foo(text) {
   var [el,setEl] = useState(null);

   useEffect(
      function onInitialRender(){
         var [el,setEl] = useState(null);
         setEl(el = document.createElement("span"));
         document.body.appendChild(el);
         el.addEventListener(.....);

         // manually trigger a re-render
         foo(text);
      },
      []  // only run this hook once at the beginning
   );

   useEffect(
      function onReRender() {
         el.innerHTML = text;
      },
      [el,text]   // only run when either text or el have changed
   );
}

Also, if the deferred effect itself returns a cleanup function, this function will be saved and run right before the next deferred effect runs.
One tricky thing to work out: when will the "last" cleanup function be run? Since we don't have a lifecycle, there's no event to trigger that. It could be that we just never fire it, or that we need to provide some programmatic way to trigger "finalization" of a function. Maybe all TNG-wrapped functions have an additional .finalize() on them?

Hi,
Nice work on bringing hooks to plain js :) I'd like to share my thoughts on the useEffect potential implementation.

On the deferral method I think that there could be multiple methods, using different strategies, as React uses useEffect for "totally" async (so the cross-platform counterpart would be setTimeout I think), and useLayoutEffect for a "sync" effect, running after component mount/update (here I'd see a microtask?)
I don't quite get why it's critical for the effect hook to have the same tng context as the function calling it. I think the preferred way would be to create a custom hook, which would first call useState and then use the state/setState callback inside useEffect.
Look at the following example

//wrapped in tng
function example() {
  useEffect(
    () => {
      const [state, setState] = useState(1);
      console.log('First effect run', state, 'times');
      setState(state + 1);
    },
    [],
  );

  useEffect(
    () => {
      const [state, setState] = useState(1);
      console.log('Second effect. Always logs 1, right?', state);
    }
  )
}

example();
example();

This breaks the 1 Hook call rule, as the first effect is run conditionally.
Instead of this, if the user really wants to use other hooks inside the callback, they might wrap it in tng instead, to create their own context. Then everything should be fine (maybe provide a useTNG hook to enable creation of functions with context "the hook way"?)
3. Cleanup. I don't think this will be able until weakRefs land in javascript-land. The good thing is that TC is working on it already (https://github.com/tc39/proposal-weakrefs) and WASM would also benefit, so it can make it to the spec. For node I've found https://github.com/TooTallNate/node-weak which could make it work even today (would probably require some periodical check if the original function was gc'd already)
4. If finalize would be added, what will be the behavior of the function when it is called and:
i. There is no cleanup yet (the effect hasn't run yet)
ii. The user wants to run the function again (should it be prohibited? Probably yes, as the function should be treated as gc'd).

About 2. Agreeing with @j3ski, you never need to call other effects from useEffect(...) conditionally, if you need - call it outside of useEffect inside context of parent wrapped function:
function example() {
  const [state, setState] = useState(1);
  useEffect(
    () => {
      console.log('First effect run', state, 'times');
      setState(state + 1);
    },
    [],
  );
}

I was thinking that being able to call useState/useReducer hooks (not useEffect) from inside an effect would mean your effect wouldn't have to be embedded inside the parent just for you to access any state variables (via closure). Also, since effects are async, closing over a state variable might mean the effect uses a stale value for that state, instead of pulling a fresh copy via useState. I personally think this is a weakness of React's current implementation, so this would be a deviation from them in terms of experimenting with that improvement. Thoughts?

I understand your point, but sharing the parent function's context would mean having the problems I mentioned (assuming we can't get around hook rule no. 1). What I'd suggest would be to have useEffect memoize and wrap it's argument in tng, to give it it's own context.
This would probably require another change to React's implementation: passing the second argument as arguments to the effect handler (so in fact making the second arg mandatory).

I understand your point, but sharing the parent function's context would mean having the problems I mentioned (assuming we can't get around hook rule no. 1). What I'd suggest would be to have useEffect memoize and wrap it's argument in tng, to give it it's own context.
This would probably require another change to React's implementation: passing the second argument as arguments to the effect handler (so in fact making the second arg mandatory).

I think it's important to note, TNG is not as constrained by the "hook rules" as is React. Specifically, quoting from the README docs for TNG:

It is absolutely required that hooks always be called in the same order. That is, that you must never have an invocation of a function that skips over an earlier hook call but then tries to invoke one of the subsequent hook calls. THIS WILL BREAK!
However, it is still technically possible to have hook calls in conditional situations (or even loops!), as long as you are very careful to never skip calls in an unsafe ordering manner.
If you have three hook calls (A, B, and C) in a function, these are the valid call ordering scenarios:

A, B, C

A, B

A
These are invalid scenarios and will break:

B, C

A, C

B

C

I think in the provided code example, both effects would run, in order, on the first call, so that would be two separate state units created, the first one set to value 2 and the second one set to value 1. Then on subsequent calls, only the second effect would run, and its useState(..) call would be accessing the first slot, which was value 2. So 2 would be logged from there on out, not 1.
Now, that might indeed be a "bug", and is clearly a gotcha that you should be avoiding. But it's not broken TNG. I'm not entirely convinced that it's symptomatic of "bad design" of effects that they access state units of the parent.
Couldn't we just as easily say that one of the "rules" is, don't access state units in two different effects unless both effects always run?

Agreed, that thg shouldn't be constrained as (or at least start off with the constrains of) React Hooks, but for me this is introducing a "gotcha" that can cause many headaches.
Say, I have a function
function getUser(userId) {
  const usersCollection = useMongo('users');
  useLogger(() => `Getting user with id ${userId}`);

  return usersCollection.findById(userId);
}

As a developer, this looks completely valid, but stops working on the second call. The reason being, that useMongo and useLogger internally call useEffect, which in turn calls useState. The difference is, useMongo calls the effect once (to connect to the database), while useLogger calls the  effect on every run.
Neither useLogger nor useMongo don't break any rules by themselves (no branching!), but used together break, so now I need to know their implementation before I use them. I don't want to use leaky abstractions!

 But allow me to just poke at this a tad... if useMongo(..) and useLogger(..) both have effects, wouldn't both of those be there own TNG wrapped functions, to isolate their respective states from each other?
I guess what I'm getting at is, it surprises me to consider custom hooks with effects at all. Maybe we shouldn't even allow that? Maybe custom hooks should only be able to access state units, but not effects... and effects then only work from directly inside a TNG wrapped function?

AFAICT, React doesn't have to worry about this problem, at the moment, because they don't let you access any hooks inside an effect. So that seems like an attractive simplification.
However, that means the scenario you're suggesting is not even possible in React -- so we don't have the case where someone would be expecting something (like the useMongo(..) / useLogger(..) gotcah) from React but it seeing it behave differently inTNG. Rather, this is "uncharted territory" where we're considering new behavior. We can thus decide under what conditions any new behavior can be added, and if we need certain constraints or rules to make sure the new stuff is "safe".
My proposition to consider:

Only useState(..) / useReducer(..) (and any other state-oriented hooks) can be accessed in custom hooks.

Thus, useEffect(..) can only be accessed from a directly TNG-wrapped function, not from a custom hook.

With those "rules", don't we avoid any of the concerns you're discussing? Or am I missing something?

Actually, I guess React does allow effects inside of custom hooks (but not other effects). But that still surprises me. I'm not sure why that should be allowed in either React or TNG?

Yes, React does allow useEffect() in custom hooks and it makes perfect sense for them, see: useWindowWidth for example. The reason being that useState() in tng is somewhat a glorified closure, while in React-world it carries additional functionality - forces the component to re-render when setState() is called. Maybe tng should also provide such a functionality (say, second argument to useState(), being a callback to run whenever setState() is called)?
Your proposed solution fixes my concerns, but then it introduces even more rules to use hooks (which isn't necessarily a bad thing). The thing that would bother me more is the fact, that hooks were created to enable logic re-use, but not allowing to use effects in custom hooks feels like a major drawback (unless you wrap the custom hook in tng, which most people would probably start to do anyway).

I think your last point is important. In TNG the point of a "custom hook" is only to share the "state" of the parent. If you want a thing that can have its own side effects, that really should be its own TNG wrapped a context. Having very indirect side effects -- effects inside of a custom hook that was called by another custom hook that was valled by another.... this seems like a horrible idea for code maintability.
Setting aside any other concerns being discussed here, it seems like a natural "best practice" to either share state or create side effects, but never both in the same function.

@getify Anything in particular I can answer without diving too deep? We intentionally don't let you call Hooks outside of top level. Not just because of technical limitations but because semantics can become deeply confusing. See https://github.com/reactjs/rfcs/pull/68#issuecomment-439314884.

@gaearon several, but I'll ask them one at a time:

(similar to a tweet thread we had recently) Do you have any concerns about an effect closing over a state variable but since it's async it could be closed over a value that's stale? This is as opposed to, as I'm proposing, being able to call a useState(..) hook from inside the effect so that the effect can access the same state slots at the parent function, and always make sure it's got the current latest version of that state.

Do you have any concerns about an effect closing over a state variable but since it's async it could be closed over a value that's stale?

It is annoying for some cases indeed.  So it's more effort to get right upfront but less bugs later. Of course that specifically applies to how we use it in React.

@getify I am not Dan so just my 2 cents :) In my opinion, it's a rare theoretical scenario to have such deep use of custom hooks. I have been fiddling with hooks in a real production app and haven't come up with a situation where I would need something like that.
However, if something like that is really needed, I don't see why it should be any harder to debug. Yes, effects run in async, but you are defining effects synchronously. There shouldn't be any problem to just set a breakpoint in the component and step through its hooks to see what's in the box. Alternatively, you can put a debugger inside the React useEffect call to see all effects that are being registered/triggered in a given period of time.

If a component called a custom hook, which called a second custom hook, which called a third custom hook, and in that third hook it created an effect... Do you have any concerns about the indirect nature of that call chain producing effects on the top-level component function and making those sorts of effects hard to see and maintain/debug if they're strewn about the code?

I don't think it's really that different from e.g. componentDidMount calling subscribeToSocket calling setupSocket. The call chain is explicit and you can always follow it, but the effect encapsulation is considered a feature. Note that the use naming convention is a big part of this — we want it to be easily visible which calls are potentially stateful/effectful. We don't want an effect to hide inside a "normal" function. And whenever you see a useSomething call, you can assume there might be state or effect there. That makes it more powerful, but that's the tradeoff. In case of React, this power gets dispersed elsewhere anyway, but in a less clear way (such as higher-order components). At least with Hooks it's easy to trace, including with a debugger step through.

The alternative, to restrict this scattering of effects, as I'm proposing, would be that neither effects nor custom hooks could create other effects, and that effects could only be created directly inside the top-level TNG function (aka, React component function). Of course, a custom hook could still use other hooks (useState(..), etc)... just not useEffect(..).

For us, that would make the whole thing not worth it. The ability to encapsulate effects is a really big use case for React because Hooks often need to hide subscriptions or other things that tie into the lifecycle.

OK, I appreciate the feedback, y'all. I still think I wish that effects could access state hooks, and I still think custom hooks making effects is a not-so-great idea/pattern. BUT... I'm not compelled enough in that to feel like it makes sense to diverge from React here. The benefit doesn't outweigh the cost. So... we'll stick with how React does it: effects have no hooks, and custom hooks can make effects.

I'm now thinking that since TNG hooks are not really expected to be used in the same context as React hooks, which is that we're not expecting them to be orchestrated by a framework the way React does. There's no implicit lifecycle, etc.
That leads me to think we should simplify the design of them to not need to be async... but rather have them be like the finally { .. } clause, which is that they run immediately after the function that invoked them (conditional of course on the state value matching, if any).
What remains in terms of open questions is:

Do we provide a finalize() method (similar to the idea of unmounting a component) on TNG-wrapped functions, so any last cleanup function(s) -- that is, any function(s) returned from useEffect(..) hooks -- are ensured to run?
I think this is the only way to mimic this part of the React lifecycle without a framework, so I think we have to. The cleanup functions can be run right before the TNG function is run on all subsequent calls, but to make sure the last cleanup happens, we have to know that you're done (aka, "not going to re-render") with the TNG-wrapped function.
Should it be called finalize()? Should it be called unmount() to more closely mimic the React roots here?

Of course, you could "finalize" a TNG-function, running all the cleanups, then run it again and it would function like a completely new call to it. So it would seem like in that case, it should then reset all the internal state slots of that TNG-wrapped function, right?

UPDATE: I've implemented useEffect(..) and have all passing tests. I'm holding off on release until a decision in #7 and according updates to docs (and error messages).

Effects are synchronous and run in order, but they run as if in a finally {..}, after the TNG-wrapped function has completed. NOTE: I plan to document that you should never rely on the synchrony or ordering of effects, as this may change in the future.

If an effect returns a cleanup function, it's run (again, in order of the original effects) right before the next invocation of the TNG-wrapped function.

To ensure any "final" cleanup functions are run, TNG-wrapped functions have a reset() function on them now. This reset() not only calls all the cleanups, but also resets all the internal state of the TNG-wrapped function. At that point, the TNG-wrapped function can be re-invoked as original.

NOTE: The name decided in #7 is "Articulated Functions" (to describe TNG-wrapped functions that are given a TNG hook context).

Released this useEffect(..) hook in v4.0.0 just now. Thanks everyone for input!


Project broke after Gradle plugin 4.1.0 update

Dependabot tried to make an update to Gradle plugin version 4.1.0 but the build failed.
I quickly found out that this was because of version-master, I tested locally by updating to the latest snapshot version and this seemed to fix it.
However I don't want to use the snapshot version in my project, would it be possible to make a new release or are there still open issues?

I was hoping to be able to stabilize the AGP version the plugin depends on, but it looks like that won't happen for a while since they're still breaking their APIs. That just means this plugin won't work with AGP 4.2.x and I'll have to release a breaking change for that.
In the meantime, I made an 0.7.0 release with breaking changes, renaming all instances of master to orchestrator to be more inclusive.

Please let me know if there are any issues.


.glb binary support

I am not seeing any option for exporting to .glb instead of multiple files. Is this something that is possible? Do I need to manually package the binary?

Same thing for importing as well.

Glb is supported for import. Export is entirely broken right now I think (unless someone corrects me). Once it's fixed though, I agree we should support glb. Lots of options there.

I do see that there is code in the project for importing .glb files but it doesn't seem to work for me. I have tried using the example importer with one of the sample assets and am getting an error.
System.Exception: Error loading asset. Assimp returns: [GLTF: Unsupported binary glTF version]
at TriLib.AssetLoader.LoadFromFile (System.String filename, TriLib.AssetLoaderOptions options, UnityEngine.GameObject wrapperGameObject) [0x0005c]

I'd like to get runtime GLB export working to support a project I'm working on. I've written my own C# class to successfully combine the .gltf and .bin files output by GLTFSceneExporter into a .glb that loads with GLTFSceneImporter by following the spec.
I think the next step would be to modify GLTFSceneExporter to export the GLB directly as a call (eg: sceneExporter.SaveGLB(string path, string filename) -- any reason I should not write the code and submit a PR?  A bit worried I may be missing some subtlety of the spec -- if it were that easy why hasn't it been implemented yet?


Search engine doc

Doc to install Elasticsearch or Algolia in Magento1
Improve a bit the 2.5 migration guide to help dealing with deprecated API
(related to questions we had this morning) : https://deploy-preview-161--heuristic-almeida-1a1f35.netlify.app/docs/appendices/migration-guides.html#Elasticsearch-in-a-dedicated-module

Could you please also take some time to document it for Magento2? (it may already be planned in an upcoming PR)


Invalid URL on Algorithm Notes

Updated link to Algorithm Notes [http://web.ntnu.edu.tw/~algo/]. The existing one looks expired.

Thanks for noticing this and the PR :)


Session limit on this device has been reached

This error is pretty unclear to me, sorry.
It seems to be related to a limit of API, but how we can check it? I'm not abusing data collect anyway...
Maybe that value could be a hint?
 'localQuota': -1474834899,

Most cases here were solved but I can't figure out how. Some users changed the  debitparameter to 100 and worked. In my case, not... :(
Since the new version of API, I'm struggling to collect data consistently.
Giving my logs, anyone can help to understand why I can't read the data stream?
Here some logs (removed intentionally user, pass and tokens). I'm using the python demo for this scenario.
** REQUEST ACCESS **
Sending request:
{"jsonrpc": "2.0", "method": "requestAccess", "params": {"clientId": "", "clientSecret": ""}, "id": 5}
sent; awaiting response
lib.cortex resp:
{'id': 5, 'jsonrpc': '2.0', 'result': {'accessGranted': True, 'message': 'The user has granted access right to this application.'}}
** AUTHORIZE **
Sending request:
{"jsonrpc": "2.0", "method": "authorize", "params": {"clientId": "", "clientSecret": "", "debit": 1}, "id": 6}
sent; awaiting response
lib.cortex resp:
{'id': 6, 'jsonrpc': '2.0', 'result': {'cortexToken': ''}}
** GET LICENSE INFO **
Sending request:
{"jsonrpc": "2.0", "method": "getLicenseInfo", "params": {"cortexToken": ""}, "id": 7}
sent; awaiting response
lib.cortex resp:
{'id': 7, 'jsonrpc': '2.0', 'result': {'isOnline': True, 'license': {'applications': ['com.emotiv.sdk.basic'], 'billingFrom': '2018-08-28T21:00:00.000-03:00', 'billingTo': '2028-08-25T21:00:00.000-03:00', 'deviceInfo': {'deviceLimit': 3, 'devicesPerSeat': 3, 'sessionLimit': {'day': None, 'month': None, 'year': None}}, 'expired': False, 'extenderLimit': 0, 'hardLimitTime': '2020-02-05T20:59:59.999-03:00', 'isCommercial': False, 'licenseId': 'd0cd774a-0639-4e45-a09f-9a349bf177e8', 'licenseName': 'Basic License', 'localQuota': -1474834899, 'maxDebit': None, 'scopes': [''], 'seatCount': 1, 'sessionCount': 1, 'softLimitTime': '2020-01-29T20:59:59.999-03:00', 'totalDebit':<PHONE_NUMBER>, 'totalRegisteredDevices': 1, 'validFrom': '2018-08-28T21:00:00.000-03:00', 'validTo': '2028-08-26T20:59:59.999-03:00'}}}
** QUERY HEADSETS **
Sending request:
{"jsonrpc": "2.0", "method": "queryHeadsets", "params": {}, "id": 8}
sent; awaiting response
lib.cortex found headsets ['INSIGHT-5A68CB86']
lib.cortex resp:
{'id': 8, 'jsonrpc': '2.0', 'result': [{'connectedBy': 'bluetooth', 'customName': '', 'dongle': '0', 'firmware': '925', 'id': 'INSIGHT-5A68CB86', 'motionSensors': ['GYROX', 'GYROY', 'GYROZ', 'ACCX', 'ACCY', 'ACCZ', 'MAGX', 'MAGY', 'MAGZ'], 'sensors': ['AF3', 'T7', 'Pz', 'T8', 'AF4'], 'settings': {'eegRate': 128, 'eegRes': 14, 'memsRate': 128, 'memsRes': 14, 'mode': 'INSIGHT'}, 'status': 'connected'}]}
** CREATE SESSION **
Sending request:
{"jsonrpc": "2.0", "method": "createSession", "params": {"cortexToken": "", "headset": "INSIGHT-5A68CB86", "status": "active"}, "id": 9}
sent; awaiting response
Got error in createSession with params {'cortexToken': '', 'headset': 'INSIGHT-5A68CB86', 'status': 'active'}:
{"error":{"code":-32019,"message":"Session limit on this device has been reached."},"id":9,"jsonrpc":"2.0"}
```

@michelpf , thanks for your feedback. what is platform you are using ?

I'm using MacOS, with Python example.

@michelpf , can you send me database of cortex at path "/Library/Application Support/Emotiv/Cortex/v2/database" via email<EMAIL_ADDRESS>

I just sent the files to you.
Yes, I tried with 0, None, 1, 10, 100, 10000000.

@michelpf I think our system has been overflow. Do you have any data on local want to keep and is not uploaded on cloud ? if not we can try:

uninstall cortex
delete folder "/Library/Application Support/Emotiv/Cortex"
install cortex again.

and pls don't debit with big number. we will fix this issue in next version.

similar problem here but using MotionLogger C# sample app:

Motion LOGGER
Please wear Headset with good signal!!!
Send getUserLogin
Press Esc to exit
Received: {"id":1,"jsonrpc":"2.0","result":[{"currentOSUId":"1001","currentOSUsername":"myName","lastLoginTime":"2020-01-10T16:34:47.814+01:00","loggedInOSUId":"1001","loggedInOSUsername":"myName","username":"myLogin"}]}
handleResponse: getUserLogin
Send hasAccessRight
Received: {"id":2,"jsonrpc":"2.0","result":{"accessGranted":true,"message":"The access right to the application has already been granted."}}
handleResponse: hasAccessRight
Send authorize
Received: {"id":3,"jsonrpc":"2.0","result":{"cortexToken":""}}
handleResponse: authorize
Authorize successfully.
FindHeadset
Send queryHeadsets
Received: {"id":4,"jsonrpc":"2.0","result":[{"connectedBy":"bluetooth","customName":"","dongle":"0","firmware":"815","id":"INSIGHT-999999","motionSensors":["GYROX","GYROY","GYROZ","ACCX","ACCY","ACCZ","MAGX","MAGY","MAGZ"],"sensors":["AF3","T7","Pz","T8","AF4"],"settings":{"eegRate":128,"eegRes":14,"memsRate":128,"memsRes":14,"mode":"INSIGHT"},"status":"connected"}]}
handleResponse: queryHeadsets
HeadsetConnectedOK INSIGHT-999999
Send createSession
Received: {"error":{"code":-32019,"message":"Session limit on this device has been reached."},"id":5,"jsonrpc":"2.0"}
Received: Session limit on this device has been reached.
MessageErrorRecieved :code -32019 message Session limit on this device has been reached.

token,password,names,serial number removed.

@mecowhy , can you show me response of request getlicenseinfo

ok now its clear, my pending free licence request ...
any ideas what can be the reason its not approved yet (10 days) ?
{"id":5,"jsonrpc":"2.0","result":{"isOnline":true,"license":{"applications":["com.emotiv.sdk.basic"],"billingFrom":"2019-10-15T02:00:00.000+02:00","billingTo":"2029-10-12T02:00:00.000+02:00","deviceInfo":{"deviceLimit":3,"devicesPerSeat":3,"sessionLimit":{"day":null,"month":null,"year":null}},"expired":false,"extenderLimit":0,"hardLimitTime":"2020-01-23T00:59:59.999+01:00","isCommercial":false,"licenseId":"5b3e4595-ef25-499e-8868-bacdaebc2420","licenseName":"Basic License","localQuota":0,"maxDebit":null,"scopes":[""],"seatCount":1,"sessionCount":0,"softLimitTime":"2020-01-16T00:59:59.999+01:00","totalDebit":0,"totalRegisteredDevices":1,"validFrom":"2019-10-15T02:00:00.000+02:00","validTo":"2029-10-13T01:59:59.999+02:00"}}}

because you did not set "debit" param in the request "authorize".
As I see "localQuota":0 and "totalDebit":0

Hi,
I set DebitNumber to 1 and got this:
Motion LOGGER Please wear Headset with good signal!!! Send getUserLogin TX: {   "jsonrpc": "2.0",   "id": 1,   "method": "getUserLogin" } Press Esc to exit RX: {   "id": 1,   "jsonrpc": "2.0",   "result": [     {       "currentOSUId": "1001",       "currentOSUsername": "__REMOVED__",       "lastLoginTime": "2020-01-10T16:34:47.814+01:00",       "loggedInOSUId": "1001",       "loggedInOSUsername": "__REMOVED__",       "username": "__REMOVED__"     }   ] } handleResponse: getUserLogin Send hasAccessRight TX: {   "jsonrpc": "2.0",   "id": 2,   "method": "hasAccessRight",   "params": {     "clientId": "__REMOVED__",     "clientSecret": "__REMOVED__"   } } RX: {   "id": 2,   "jsonrpc": "2.0",   "result": {     "accessGranted": true,     "message": "The access right to the application has already been granted."   } } handleResponse: hasAccessRight Send authorize TX: {   "jsonrpc": "2.0",   "id": 3,   "method": "authorize",   "params": {     "clientId": "__REMOVED__",     "clientSecret": "__REMOVED__",     "debit": 0   } } RX: {   "id": 3,   "jsonrpc": "2.0",   "result": {     "cortexToken": "__REMOVED__"   } } handleResponse: authorize Authorize successfully. FindHeadset Send queryHeadsets TX: {   "jsonrpc": "2.0",   "id": 4,   "method": "queryHeadsets" } Send getLicenseInfo TX: {   "jsonrpc": "2.0",   "id": 5,   "method": "getLicenseInfo",   "params": {     "cortexToken": "__REMOVED__"   } } RX: {   "id": 4,   "jsonrpc": "2.0",   "result": [     {       "connectedBy": "dongle",       "customName": "",       "dongle": "6ff",       "firmware": "565",       "id": "EPOC-__REMOVED__",       "motionSensors": [         "GYROX",         "GYROY"       ],       "sensors": [         "AF3",         "F7",         "F3",         "FC5",         "T7",         "P7",         "O1",         "O2",         "P8",         "T8",         "FC6",         "F4",         "F8",         "AF4"       ],       "settings": {         "eegRate": 128,         "eegRes": 14,         "memsRate": 128,         "memsRes": 14,         "mode": "STANDARD"       },       "status": "connected"     },     {       "connectedBy": "bluetooth",       "customName": "",       "dongle": "0",       "firmware": "0",       "id": "INSIGHT-__REMOVED__",       "motionSensors": [],       "sensors": [],       "settings": {         "eegRate": 128,         "eegRes": 0,         "memsRate": 0,         "memsRes": 0,         "mode": "UNKNOWN"       },       "status": "discovered"     }   ] } handleResponse: queryHeadsets HeadsetConnectedOK EPOC-__REMOVED__ Send createSession TX: {   "jsonrpc": "2.0",   "id": 6,   "method": "createSession",   "params": {     "headset": "EPOC-__REMOVED__",     "cortexToken": "__REMOVED__",     "status": "active"   } } RX: {   "error": {     "code": -32019,     "message": "Session limit on this device has been reached."   },   "id": 6,   "jsonrpc": "2.0" } Received: Session limit on this device has been reached. MessageErrorRecieved :code -32019 message Session limit on this device has been reached. RX: {   "id": 5,   "jsonrpc": "2.0",   "result": {     "isOnline": true,     "license": {       "applications": [         "com.emotiv.sdk.basic"       ],       "billingFrom": "2019-10-15T02:00:00+02:00",       "billingTo": "2029-10-12T02:00:00+02:00",       "deviceInfo": {         "deviceLimit": 3,         "devicesPerSeat": 3,         "sessionLimit": {           "day": null,           "month": null,           "year": null         }       },       "expired": false,       "extenderLimit": 0,       "hardLimitTime": "2020-01-23T00:59:59.999+01:00",       "isCommercial": false,       "licenseId": "5b3e4595-ef25-499e-8868-bacdaebc2420",       "licenseName": "Basic License",       "localQuota": 0,       "maxDebit": null,       "scopes": [         ""       ],       "seatCount": 1,       "sessionCount": 0,       "softLimitTime": "2020-01-16T00:59:59.999+01:00",       "totalDebit": 0,       "totalRegisteredDevices": 1,       "validFrom": "2019-10-15T02:00:00+02:00",       "validTo": "2029-10-13T01:59:59.999+02:00"     }   } } handleResponse: getLicenseInfo

@mecowhy which line code you changed to set debit = 1. I still see "debit" 0 when send request to cortex
TX: {   "jsonrpc": "2.0",   "id": 3,   "method": "authorize",   "params": {     "clientId": "__REMOVED__",     "clientSecret": "__REMOVED__",     "debit": 0   } }

ok now its working , previously I had licenceID field empty in Config class, now I used value from getLicenceInfo response and its working.

It worked!
Thank you so much!

This issue solved my issue too -- any chance you could update the official documentation on your website to reflect the necessity of including "debit": 1 in the "method": authorize API call?
https://emotiv.gitbook.io/cortex-api/authentication/authorize


Uninstall drive

With ther frequent versions available I was trying to do a clean test with no historical baggage. The drive init command does not forget old directorires. Could the wiki and/or doc files include a list of files (including the hidden ones) to delete to ensure a clean start.
regards CB

Ah I see what you mean. I'll get that in in the morning. Thanks for the clarification.

To uninstall drive:

Executable will be located at: $GOPATH/bin/drive
Mounted folder: remove your mounted folder
++ Credentials will be in a hidden file in your mounted folder ie. mounted_folder/.gd
Source code: $GOPATH/src/github.com/odeke-em/drive

You can remove those from their appropriate paths.


Runtime type error in dart pad (compiled by dart2js) but not on VM

The following code runs successfully on VM and Chrome (if compiled with DDC), but fails on dart pad with a runtime error (or in chrome when compiled with dart2js):
// @dart = 2.17
import 'dart:async';

void main() {
  final controller = StreamController<Map<String, Object?>>();
  controller.stream.listen(print);
  addFoo(controller.sink);
  print('done');
}

void addFoo(StreamSink<Map<String, Object?>> sink)   {
  if (sink is StreamSink<Map<String, Object>>) throw 'bad sink'; // Removing this line makes the code work
  sink.add({'foo': 'bar'});
}

Expected
_StreamSinkWrapper<Map<String, Object?>>
done
{foo: bar}

Actual
_StreamSinkWrapper<Map<String, Object?>>
Uncaught TypeError: t1.add$1 is not a functionError: TypeError: t1.add$1 is not a function

Reduced example with no imports:
class Foo<T> {
  void blah() => print("Foo");
}

void main() {
  final foo = Foo<Object?>();
  if (foo is Foo<Object>) throw 'bad foo';
  foo.blah();
}

The static type computation in dart2js doesn't take nullability into account. I'm working on correcting this.


class enhancement

Class 'DirectordConnect' inherits from object, can be safely removed from bases in python3

Class 'UNIXSocketConnect' inherits from object, can be safely removed from bases in python3

Class 'SystemdInstall' inherits from object, can be safely removed from bases in python3

Class 'Mixin' inherits from object, can be safely removed from bases in python3


feat(Table): add checkbox base to ui config

❓ Type of change

[ ] 📖 Documentation (updates to the documentation or readme)
[ ] 🐞 Bug fix (a non-breaking change that fixes an issue)
[x] 👌 Enhancement (improving an existing functionality)
[ ] ✨ New feature (a non-breaking change that adds functionality)
[ ] 🧹 Chore (updates to the build process or auxiliary tools and libraries)
[ ] ⚠ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description
This change stems from a need to change Checkbox size globally, but only in Table.
Instead of creating checkbox size param, this enhances already existing config, gives ability to change not only size-{} class but others as well.
Docs reflect this change accordingly, my guess, some auto generation from table.ts
📝 Checklist

[ ] I have linked an issue or discussion.
[ ] I have updated the documentation accordingly.

Feel free to reopen if you want to update the PR with the recommendations above.


⚠ Jenkins Plugins Artifactory has degraded performance

In c95d7a0, Jenkins Plugins Artifactory (https://get.jenkins.io/plugins/artifactory/) experienced degraded performance:

HTTP code: 200
Response time: 1216 ms

Resolved: Jenkins Plugins Artifactory performance has improved in ff17dc3 after 14 minutes.


Specify non-database fields to track for changes

Adding ability to specify non-database fields to track for changes. This combines with changes method override to allow you to track arbitrary values, if needed

I think this is a good idea, but I don't love the DSL. I think there's little difference between a database field and a method and an attribute or some other thing, so maybe we want to be able to just say track_history fields: ... and this will cause the tracker to only track the fields specified. There should be an easy way to say all fields + some methods, so I think it's as straightforward as track_history fields: Klass.fields.keys. What do you think?

Not just a good idea, but a necessary change as some of the encouraged functionality (custom changes method to store embedded documents saved via nested attributes) does not work without it.
Right now, the code double checks the fields, once against them existing on the database and again against the on array. I chose to add the additional option instead of changing the default behavior of looping through the fields array. The effect is to only include those in common between the on array and the fields.keys array.
I can write it to just use the on array if provided, if that's what everyone would prefer.

For rubocop do this:
rubocop -a
rubocop --auto-gen-config

The on attribute is better, good suggestion.

I get it. I am down with this change. It needs a CHANGELOG entry and I think I want more/better README explanations, and please squash the commits.

Any update on getting this merged in? If you have any suggestions for what you'd want to see in the README, I'm all out of ideas.

Sorry, github doesn't send notifications on updates. See my comments around the README, amend, and add a note and I'll merge.

This should be ready to go.

Looking good, merging.


(Demo) implementation of better Wikidata fetching

See https://twitter.com/larswillighagen/status/1102647476882948096. Before implementation in wikidata-sdk, implement here (which should speed up the process there too.

Removed from the milestone because it isn't really relevant.

Demo in fe72fb3de0eedd58ae862f3d5f46aab360cf12b4


Great work but there is already another package

Hi @MihaelIsaev Great work with the package
Nodes needs a FB push package soon also.
We previously used https://github.com/mdab121/vapor-fcm by @mdab121
That package is not ready for vapor 3 yet.
And we a had a conversation with him to move it to the community to get more features in.
Is that something you could be interested in also?

Hey @Casperhr thank you.
Yeah I saw mdab121's lib before I started developing my own.
I waited three month and as there are no movings to port mdab121's lib to Vapor 3 I made a decision to create fcm lib by myself because I need push notifications functionality on my projects right now.
You could use this package in your projects and I'm interested and appreciate pull requests with new features. Hope that my package will be useful for you.

Hey @MihaelIsaev. My package will be ready for vapor 3 soon. Sorry for the delay ;)


[2.x] [WCFORE-1845] During boot skip validating/verifying runtime resources

During boot runtime resources should be ignored for validation. This also expands the resource to allow for a shallow copy of the resource. This is useful when child values may not be important, but the child key is important.
Master PR https://github.com/wildfly/wildfly-core/pull/1870

Core - Full Integration Build 71 outcome was FAILURE using a merge of 95629309bb682083480bec00fc345613978f8c9c
Summary: Tests failed: 1 (1 new), passed: 3399, ignored: 193 Build time: 01:05:47
Failed tests
org.jboss.as.test.xts.annotation.compensationScoped.CompensationScopedTestCase.shouldSeeDifferentValuesInDifferentTransactions: com.arjuna.mw.wsas.exceptions.WrongStateException: ARJUNA041018: Cannot enlist child activity with parent as parent's status is: Status.Completed
	at com.arjuna.mwlabs.wsas.activity.ActivityImple.addChild(ActivityImple.java:583)
	at com.arjuna.mwlabs.wsas.activity.ActivityImple.start(ActivityImple.java:160)
	at com.arjuna.mwlabs.wsas.UserActivityImple.start(UserActivityImple.java:136)
	at com.arjuna.mwlabs.wsas.UserActivityImple.start(UserActivityImple.java:99)
	at com.arjuna.mwlabs.wscf.model.sagas.arjunacore.CoordinatorServiceImple.begin(CoordinatorServiceImple.java:108)
	at org.jboss.narayana.compensations.impl.local.LocalBAController.beginBusinessActivity(LocalBAController.java:28)
	at org.jboss.as.test.xts.annotation.compensationScoped.CompensationScopedTestCase.shouldSeeDifferentValuesInDifferentTransactions(CompensationScopedTestCase.java:76)
------- Stdout: -------
 [0m14:08:22,668 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 88) WFLYUT0022: Unregistered web context: /transactional-test
 [0m [0m14:08:22,672 INFO  [org.jboss.as.webservices] (MSC service thread 1-3) WFLYWS0004: Stopping service jboss.ws.endpoint."transactional-test.war".TransactionalServiceImpl
 [0m [0m14:08:22,687 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-7) WFLYSRV0028: Stopped deployment transactional-test.war (runtime-name: transactional-test.war) in 19ms
 [0m [0m14:08:22,692 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 84) WFLYCLINF0003: Stopped client-mappings cache from ejb container
 [0m [0m14:08:22,702 INFO  [org.jboss.as.repository] (management-handler-thread - 1) WFLYDR0002: Content removed from location /opt/buildAgent/work/93ecd9ad966b2aa5/full/testsuite/integration/xts/target/jbossas/standalone/data/content/4d/20bddd42195e873e76bba10cccedcc7214dafc/content
 [0m [0m14:08:22,702 INFO  [org.jboss.as.server] (management-handler-thread - 1) WFLYSRV0009: Undeployed "transactional-test.war" (runtime-name: "transactional-test.war")
 [0m [0m14:08:23,622 INFO  [org.jboss.as.repository] (management-handler-thread - 2) WFLYDR0001: Content added at location /opt/buildAgent/work/93ecd9ad966b2aa5/full/testsuite/integration/xts/target/jbossas/standalone/data/content/30/710e64b4572840c3207a079b39671a5f9e0d51/content
 [0m [0m14:08:23,628 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0027: Starting deployment of "test.war" (runtime-name: "test.war")
 [0m [0m14:08:23,846 INFO  [org.jboss.weld.deployer] (MSC service thread 1-5) WFLYWELD0003: Processing weld deployment test.war
 [0m [0m14:08:24,092 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 92) WFLYUT0021: Registered web context: /test
 [0m [0m14:08:24,100 INFO  [org.jboss.as.server] (management-handler-thread - 2) WFLYSRV0010: Deployed "test.war" (runtime-name : "test.war")
 [0m


Support for kebab case target names

The controller names supports kebab case, since they only used to connect with filenames.  But the same approach of kebab case don't work well with static targets.
Or, is it advised to stick with camelCase for all names in Stimulus?

export default class extends Controller {
  static targets = ['drop-area'];

  connect() {
   //  Excepts to work this.dropAreaTarget
  }
}

Target names map directly to property names so it's best to stick with camelCase. See https://github.com/stimulusjs/stimulus/issues/70#issuecomment-359991756 for a rundown of the capitalization conventions.


No sound when downloading

Hi, i downloaded your youtube playlist downloader, it's really good and really helpful. however i tried downloading videos today and the videos have no sound, like it didn't before but after downloading these videos, anything after had no sound. idk why, like idk if it's a copyright problem or something. i sure would like some help. It's specific videos too, like some videos work fine but i can't figure out why some vids have no sound

Do you use the built in media player in windows? It's outdated and doesn't support youtube's formats, try opening the files with VLC.

i'm not sure, i just download it through it and it's worked fine. it's specific videos only, i worked around it tho. i Just want to know why it affects specific videos. Idk if it's a bug cuz it works for some other downloaders so.

hi, i Downloaded and tried using VLC, all the videos that are silent, it works! Amazing thanks man!

also why can't this application download 18+ videos? like age restriction on youtube? it should cuz that's all this is missing

It's impossible to download age restricted videos without logging in, and I don't plan to support logging in.
Glad your problem was sovled


Always show request timer with one decimal precision

I was slightly bothered by the request timer jumping because it was reducing its precision when it reached .0. I therefore propose to always call toFixed(1) on it for a nicer look.
Before

After

Thank you, this was super quick! 🚀

No problem. Thank you! Your patch will appear in the next release, hopefully by the end of the week. Congrats on your first contribution 👍 😄


Viewport prefetching

Describe the problem
Currently sveltekit:prefetch works by requesting data on hover or before click only. In some cases, it may be desirable to prefetch immediately when the link enters the viewport, similar to how nextjs works today.
https://github.com/sveltejs/kit/discussions/3041 also highlighted some points there.
Describe the proposed solution
Provide a way to define the prefetching strategy, either by viewport or hover. This can be achieved by passing a value to the attribute, e.g. sveltekit:prefetch="<strategy>". By default with no value, it would fallback to the hover strategy.
For viewport prefetching, IntersectionObservers can't be used as anchor tags change often and to detect that MutationObservers are needed, but that imposes a lot of potential overhead. An alternative is to query select anchor tags and prefetch them in short intervals. (Ideas welcomed)
To detect when to invalidate the data, maxage can be used. To avoid discouraging short maxage (which indirectly cause repeated prefetching), a syntax like sveltekit:prefetch="viewport:1000" could be supported to denote "invalidate after 1s". Or a config option can be used to set a minimum prefetch interval (similar https://github.com/sveltejs/kit/issues/790)
Alternatives considered
Refer users to implement their own viewport prefetch logic using actions. Caveat is that links in contents from CDN can't take advantage of the declarative prefetching syntax.
Importance
nice to have
Additional Information

Rich noted that prefetch invalidation may not always be wasteful as the modules requested are usually reusable, only the data is stale.
Adding viewport prefetch implementation may require some infrastructure refactoring.
I might've forgotten some points from the last maintainer's meeting.

Just wanted to chime in again that adding that kind of config to every single anchor element in an app is a lot of user overhead in terms of DX that's also prone to user-error, and imo if this was implemented that's an even stronger argument for adding support to prefetch all relative links by default at the same time, with this stuff configured globally in the same place. A prefetch option under kit in svete.config.js feels like a no-brainer, with per-link overrides possible.

.

Another strategy might be 'focus'. If I navigate to a link with the tab key, maybe that link should start prefetching? Then again, doing so would typically mean prefetching all the links you tab through until you get to the one you want, so maybe not. Unclear. At the very least we should prefetch on keydown for focused links.

this can be closed now that we have data-sveltekit-preload-code="viewport"
https://kit.svelte.dev/docs/link-options#data-sveltekit-preload-code


Performance Issue

Product and Version: 1.39.0-insider
Live Share Extension Version: 0.1.66
OS Version: Windows_NT x64 10.0.18362
liveshare-audio_logs.zip

@forgetful-glitch , Thanks for reaching out and attaching your logs. Would you describe more the performance issue you are having. Is the audio connection takes long ? or is it a voice quality ? etc...