from channels.sessions import enforce_ordering


#@enforce_ordering(slight=True)
def ws_connect(message):
    pass


#@enforce_ordering(slight=True)
def ws_message(message):
    "Echoes messages back to the client"
    message.reply_channel.send(message.content)

from channels.sessions import enforce_ordering


#@enforce_ordering(slight=True)
def ws_connect(message):
    pass


#@enforce_ordering(slight=True)
def ws_message(message):
    "Echoes messages back to the client"
    message.reply_channel.send({
        "text": message['text'],
    })

Fix echo endpoint in testproject
Fix echo endpoint in testproject

  from channels.sessions import enforce_ordering
  
  
  #@enforce_ordering(slight=True)
  def ws_connect(message):
      pass
  
  
  #@enforce_ordering(slight=True)
  def ws_message(message):
      "Echoes messages back to the client"
-     message.reply_channel.send(message.content)
+     message.reply_channel.send({
+         "text": message['text'],
+     })
  
Fix echo endpoint in testproject
## Code Before:
from channels.sessions import enforce_ordering


#@enforce_ordering(slight=True)
def ws_connect(message):
    pass


#@enforce_ordering(slight=True)
def ws_message(message):
    "Echoes messages back to the client"
    message.reply_channel.send(message.content)

## Instruction:
Fix echo endpoint in testproject
## Code After:
from channels.sessions import enforce_ordering


#@enforce_ordering(slight=True)
def ws_connect(message):
    pass


#@enforce_ordering(slight=True)
def ws_message(message):
    "Echoes messages back to the client"
    message.reply_channel.send({
        "text": message['text'],
    })
